Sha256: 5cd3af0ded8a1750187dff3459ef99171ca93eeb3d434b98090537f4240ec752

Contents?: true

Size: 474 Bytes

Versions: 11

Compression:

Stored size: 474 Bytes

Contents

module CloudSesame
  module Query
    module AST
      class Near < SingleExpressionOperator
        DETAILED = true
				SYMBOL = :near

				def compile(detailed = nil)
          if child && (compiled = child.compile operator_detailed) && !compiled.empty?
            "(#{ symbol }#{ boost }#{ distance } #{ compiled })"
          end
				end

        def distance
          " distance=#{ options[:distance] }" if options[:distance]
        end

      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
CloudSesame-0.6.4 lib/cloud_sesame/query/ast/near.rb
CloudSesame-0.6.3 lib/cloud_sesame/query/ast/near.rb
CloudSesame-0.6.2 lib/cloud_sesame/query/ast/near.rb
CloudSesame-0.6.1 lib/cloud_sesame/query/ast/near.rb
CloudSesame-0.6.0 lib/cloud_sesame/query/ast/near.rb
CloudSesame-0.5.5 lib/cloud_sesame/query/ast/near.rb
CloudSesame-0.5.4 lib/cloud_sesame/query/ast/near.rb
CloudSesame-0.5.3 lib/cloud_sesame/query/ast/near.rb
CloudSesame-0.5.2 lib/cloud_sesame/query/ast/near.rb
CloudSesame-0.5.1 lib/cloud_sesame/query/ast/near.rb
CloudSesame-0.5.0 lib/cloud_sesame/query/ast/near.rb