Hi Chris, I recreate your issue to the following gist.
https://gist.github.com/johtani/8346404 And I try to change query as follows: User_Name.raw:bob.smith-jones -> matches User_Name.raw:bob.smi* -> matches User_Name.raw:bob.smith-j* -> matches User_Name.raw:bob.smith\-j* -> matches I use User_Name.raw field instead of User_Name. Sorry, not necessary to escape… And I don’t know why do not work Brian example’s query_string query… Does it make sense? Is this understanding mistaken? ------------ Jun Ohtani [email protected] blog : http://blog.johtani.info twitter : http://twitter.com/johtani 2014/01/10 2:09、InquiringMind <[email protected]> のメール: > Chris, > > I updated one of my tests to reproduce your issue. My text field is a > multi-field where text.na is the text field without any analysis at all. > > This Lucene query does not find anything at all: > > { > "bool" : { > "must" : { > "query_string" : { > "query" : "text.na:Immortal-Li*" > } > } > } > } > > But this one works fine: > > { > "bool" : { > "must" : { > "prefix" : { > "text.na" : { > "prefix" : "Immortal-Li" > } > } > } > } > } > > And returns the two documents that I expected: > > { "_index" : "mortal" , "_type" : "elf" , "_id" : "1" , "_version" : 1 , > "_score" : 1.0 , "_source" : > { "cn" : "Celeborn" , "text" : "Immortal-Lives forever" } } > > { "_index" : "mortal" , "_type" : "elf" , "_id" : "2" , "_version" : 1 , > "_score" : 1.0 , "_source" : > { "cn" : "Galadriel" , "text" : "Immortal-Lives forever" } } > > Note that in both cases, the query's case must match since the field value is > not analyzed at all. > > I'm not sure if this is a true bug. In general, I find Lucene syntax somewhat > useful for ad-hoc queries, and I find their so-called Simple Query Parser > syntax to be completely unable to find anything when there is no _all field, > whether or not I specify a default field. (But that's another issue I'm going > to ask about in the near future.) > > Brian > > On Thursday, January 9, 2014 8:27:04 AM UTC-5, Chris H wrote: > Hi, Jun. > > That doesn't seem to work. For a user with the username bob.smith-jones: > • bob.smith-jones -> matches > • bob.smith-aaaa -> matches > • bob.smi* -> matches > • bob.smith-j* -> no results > • bob.smith\-j* -> no results > Also, a "$" isn't one of the special characters. > > Thanks. > > -- > You received this message because you are subscribed to the Google Groups > "elasticsearch" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/elasticsearch/6cb908eb-9ca7-4f05-815f-a868c45f9f66%40googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out.
signature.asc
Description: Message signed with OpenPGP using GPGMail
