Anand
Anand

Reputation: 10400

Sphinx query for "starts-with" condition

I am trying a query to search a table in which names start with a letter g.

"hospital @name ^g"

Is this right ? I am getting 0 results for it even after indexing the table with names and all other columns.

Upvotes: 0

Views: 572

Answers (1)

Manticore Search
Manticore Search

Reputation: 1482

Do you have min_prefix_len set to 1 for that index? Without this Sphinx treats "g" as a separate word and will match only those documents that start with one-letter word "g", for example "g anotherword".

Upvotes: 1

Related Questions