Try comparing strings char by char. White spaces are sometimes unprintable 
characters.Eric.Sent from my Samsung Galaxy smartphone.
-------- Original message --------From: Angel Todorov <attodo...@gmail.com> 
Date: 2018-11-15  04:06  (GMT-05:00) To: solr-user@lucene.apache.org Subject: 
Re: querying on field of type string doesn't work as expected hi Erik,Thanks, 
but neither of those seem to work. (neither "Some\ Text" , norSome\ Text). 
Also, assuming I may have many fields with different types, Idon't think this 
is a very good design to leave it up to the applicationdeveloper to have 
different encoding based on what the underlying SOLRfield type is. To me "Some 
Text" is exactly this - a case-sensitive phrase,enclosed in quotes. I think 
SOLR should be responsible for figuring out howto apply this in the underlying 
query parser depending to whether the fieldis text or string type. But anyway, 
I am still trying to solve this issuebecause it seems that matching against 
string types which have spacessimply doesn't work (at least for me?). I've 
tried adding debug true, andhere is what it says :  
"response":{"numFound":0,"start":0,"docs":[]  },  "debug":{    
"rawquerystring":"MyCustomField:Some\\ Text",    
"querystring":"MyCustomField:Some\\ Text",    "parsedquery":"MyCustomField:Some 
Text",    "parsedquery_toString":"MyCustomField:Some Text",    "explain":{},    
"QParser":"LuceneQParser", "response":{"numFound":0,"start":0,"docs":[]  },  
"debug":{    "rawquerystring":"MyCustomField:\"Some Text\"",    
"querystring":"MyCustomField:\"Some Text\"",    
"parsedquery":"MyCustomField:Some Text",    
"parsedquery_toString":"MyCustomField:Some Text",    "explain":{},    
"QParser":"LuceneQParser",Thank youOn Thu, Nov 15, 2018 at 3:54 AM Erick 
Erickson <erickerick...@gmail.com>wrote:> No it doesn't match. You have to get 
the search in as a single term.>> You get a lot of information by adding 
&debug=true and looking at your> parsed query.>> Try> myFieldName:"Some\ Text"> 
o> myFieldName:Some\ Text>> Best,> Erick> On Wed, Nov 14, 2018 at 4:02 PM Angel 
Todorov <attodo...@gmail.com> wrote:> >> > Hi guys,> >> > I have SOLR 6.5 , and 
a custom defined field which is of type string (not> > text or text_general). 
In some document, there is the value for that> field,> > for example, "Some 
Text" . When I query by myFieldName:"Some Text" , I> > don't get any matches, 
but I think I should, because this matches the> value> > literally/precisely, 
and the type is "string".> >> > If I do the following query, it returns the 
correct results> >  myFieldName:Some*Text> >> > Why do you think this is 
happening?> >> > Thank you>

Reply via email to