4

I can only find exact phrase matching for queries in the experimental Search API for Google App Engine. For example the query 'best prices hotel' will only match that exact phrase. It will not match texts such as 'best hotel prices' or 'best price hotels'. It's of course a much more difficult task to match text in a general way but I thought the Search API would at least be able to handle some of that.

Another example is the query 'new cars' which will not match the text 'new and used cars'.

RLH
  • 15,230
  • 22
  • 98
  • 182
Anders
  • 71
  • 5
  • 1
    The question is if a more general phrase matching is available in the new Search API. I have now solved it somewhat by using a query like 'text_field:(best AND prices AND hotel) which actually works pretty well and I can expand on that solution perhaps. – Anders May 09 '12 at 21:14
  • 1
    You've got the right idea. Namely breaking up the words into a boolean search phrase that's appropriate for your requirements (AND vs OR). – Corey Burke May 09 '12 at 23:33
  • Yes, for the example, a query like this works quite well: (best AND (prices OR price) AND (hotel OR hotels)) – Anders May 09 '12 at 23:50
  • 1
    Also, I believe that this query should give you the same result: `best (prices OR price) (hotel OR hotels)`. For the 'new cars' example, don't enclose it in quotes (that makes it a phrase), but just search for `new cars`, which is implicitly `new AND cars`. – Amy U. May 10 '12 at 05:13
  • The single quotes I used was a bit misleading. What I meant is using queries on particular fields and then quotes are needed for phrases which means that no implicit AND is used, such as: field:"value as a string" – Anders May 10 '12 at 06:17
  • 2
    I recommend starring and following this issue (http://goo.gl/9l2bz) over at the GAE Search API tracker page. Also, specifically request this type of functionality, though I'm sure that smart people at Google would implement this if the did implement a fuzzy search logic to document searching. – RLH May 16 '12 at 14:06

1 Answers1

0

You should be able to use the '~' operator to rewrite queries to include plurals. E.g., ~hotel or ~"best prices hotel".

Documentation about this operator should be added in the next app engine SDK release.

Amy U.
  • 2,227
  • 11
  • 11