the *real* issue is that SOLR expects a character with a code of 160 for space, while the standard space as typed from a keyboard has a code of 32. Both appear exactly the same. Here's where the issue comes from. If i generate the 160 space, and copy paste it, it works fine for string even like this "Some Text".
But why does SOLR do this ? Thanks On Mon, Nov 19, 2018 at 11:50 PM Angel Todorov <attodo...@gmail.com> wrote: > The only thing that works is this: {!term f=MyCustomField}Some Text > > Thanks > > > On Thu, Nov 15, 2018 at 7:13 PM Erick Erickson <erickerick...@gmail.com> > wrote: > >> Well, there's little likelihood that Solr will be changed this way. If >> your field were a text-based field that had a lowercase as part of >> it's analysis chain, then what would you expect from searching for >> "Some Text"~3? An exact match ignoring the slop? Or searching "Some >> Text" (against against a text-based field that lowercased). Would you >> expect it to match the lower-case that's the result of the analysis >> chain? >> >> And string types are totally unanalyzed, so case matters. As do extra >> spaces. And you can use the schema browser to see what terms are >> actually in your index. >> >> Best, >> Erick >> On Thu, Nov 15, 2018 at 4:14 AM e_briere <e_bri...@videotron.ca> wrote: >> > >> > 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> >> >