Hi
Can someone explain to me why these 2 queries don't return the same?
1. select Id from table where text likep 'keyword1,"keyword2 keyword3"'
=> Find a match
2. select Id from table where text likep 'keyword1,keyword2 keyword3 w/150'
=> Doesn't return any match.
I'd like to have the following query:
search for: keyword1 or keyword2 near keyword3.
Also, what exactly is the difference between the likep and like predicates in terms of support of metamorph queries?
In 1 you are looking for keyword1 and the phrase "keyword2 keyword3" anywhere in the document. In the second one you are looking for all three keywords within 150 characters. You need to parenthesize the second query:
(keyword1,keyword2) keyword3 w/150
to generate an equivalence set of keyword1 and keyword2.
Parens in metamorph are used for "equiv" sets, generall lists of words that mean the same thing. Any one of them will satisfy that "term" of the query (like an or). Words within () must be delimited by , with no extra spaces.
Outside of parens , and space are the same as far as query parsing goes except for special pattern matchers like rex etc. where , is not used as a delimiter. I prefer to use spaces rather than commas to reduce confusion.
You'll need to do your query with a sql "or"
... likep 'keyword1' or ... likep 'keyword2 keyword3 w/150' ...