tags:

views:

26

answers:

1

The Underscore '_' works like an AND, doesn't it?

When searching for any of

test_12 , 12_test , 12 AND test , test AND 12

I get the same hit.

But why is there a problem with the wildcard?

mytest* AND abc_IN_CRM_C  --> finds results!
abc_IN_CRM_C_mytest* --> no results!
abc_IN_CRM_C AND mytest* --> results ?!

What am I doing wrong?

A: 

If you are using the StandardAnalyzer, then the text is split on underscores. That's why you get the same results as using "AND".

Also see http://stackoverflow.com/questions/2520479/lucene-search-and-underscores

Mikael Svenson
what does split mean? really two words? than should be the last to querys be equal, don't they? but why are the results different?
tim
I don't have a lucene install at hand, but it might be that it tokenizes it differently with the wildcard.
Mikael Svenson