hi Erik,

Thanks, but neither of those seem to work. (neither "Some\ Text" , nor
Some\ Text). Also, assuming I may have many fields with different types, I
don't think this is a very good design to leave it up to the application
developer to have different encoding based on what the underlying SOLR
field 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 how
to apply this in the underlying query parser depending to whether the field
is text or string type. But anyway, I am still trying to solve this issue
because it seems that matching against string types which have spaces
simply doesn't work (at least for me?). I've tried adding debug true, and
here 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 you


On 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