Page 1 of 1

AND /OR search

Posted: Wed May 05, 2004 6:06 pm
by chakotay
1st search:
ID like '@0 11742749 "1192484" 11192488 11735967'
Returns 2 hits. (11192488, 11735967)

2nd search:
ID > '11294103' AND ID < '11294106'
Returns 2 docs (11294104, 11294105)

now if i combine these two searches above with an 'OR' connector it retunrs 15 hits.

ID > '11294103' AND ID < '11294106' OR ID like '@0 11742749 "1192484" 11192488 11735967'

15 hits :(11192484 11192488 11294104 11294105 11735967 11924840 11924841 11924842 11924843 11924844 11924845 11924846 11924847 11924848 11924849)

looks like the double quotes around "1192484" treats it as a LIKE search only when the OR operator is used to connect both searches. I tried [ID like "1192484"] and got 0 hit.

Has anyone come across similar anomaly? I am not sure if this is an expected behavior of texis. Any help would be appreciated.

Thanks in advance.

AND /OR search

Posted: Wed May 05, 2004 6:38 pm
by chakotay
If i drop the index then [ID like "1192484"] returns hits. (11192484,11924840,11924841,11924842,11924844,11924845,
11924846,11924847,11924848,11924849)
Recreated the index, got ZERO hits for the same term.

So it looks like if i use the OR connector, somehow the search is not using the index.

AND /OR search

Posted: Wed May 05, 2004 10:07 pm
by John
The double quotes are irrelevant. When not using the index the default settings will allow numerics to be found as a substring. None of the matches are exactly 1192484, which is what the indexed LIKE is looking for. To get consistent results make sure that the index expression and wordc/langc agree what a word is.

AND /OR search

Posted: Thu May 06, 2004 5:29 pm
by jkj2001
I'm not sure I follow-- is one of the lessons here that OR searches won't use indexes under certain circumstances? If so, what are they?

AND /OR search

Posted: Thu May 06, 2004 5:53 pm
by mark
Nothing to do with logic or quotes. It's indexed vs. linear search. wordc/langc control what linear search considers a word and if it's language or random string. index expressions control what the index search considers a word. If your wordc/langc aren't compatible with your index expression you may get different results when linear searching vs. indexed searching.

AND /OR search

Posted: Thu May 06, 2004 6:12 pm
by John
OR can use indexes only if both sides of the OR are indexable. With both relational (less than or greater than) queries, and LIKE queries you would need both regular and metamorph indexes to resolve the query with an index. If either side of the OR is not indexable then the entire OR is not indexable.

AND /OR search

Posted: Thu May 06, 2004 7:21 pm
by jkj2001
Ah, now I see-- thanks guys