Metamorph Query

Post Reply
tony.malandain
Posts: 57
Joined: Sat Mar 27, 2004 6:39 pm

Metamorph Query

Post by tony.malandain »

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?

Thanks,
/Tony.
User avatar
John
Site Admin
Posts: 2622
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:

Metamorph Query

Post by John »

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.
John Turnbull
Thunderstone Software
tony.malandain
Posts: 57
Joined: Sat Mar 27, 2004 6:39 pm

Metamorph Query

Post by tony.malandain »

well actually I need to have keyword1 or (keyword2 near keyword3).

I tried with parentheses as well:
keyword1,(keyword2 keyword3 w/150)
and
keyword1 (keyword2 keyword3 w/150)

but it didn't return any match.

Another thing that confuses me: what's the difference between using a coma or a space to separate keywords?

/T.
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

Metamorph Query

Post by mark »

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' ...
Post Reply