Solr Query not parsing forward slash

前端 未结 3 1620
悲哀的现实
悲哀的现实 2020-12-11 02:46

Is the forward slash \"/\" a reserved character in solr field names?

I\'m having trouble writing a solr sort query which will parse for fields containing a forward s

3条回答
  •  青春惊慌失措
    2020-12-11 03:12

    In my case I needed to search for forward slash / with wild card *, e.g.:

    +(*/*)
    +(*2016/17*)
    

    I Tried to escape it like so:

    +(*2016\/*)
    +(*2016\/17*)
    

    but that didn't work also.

    the solution was to wrap the text with double quote " like do:

    +("*\/*")
    +("*/*")
    
    +("*2016\/17*")
    +("*2016/17*")
    

    both returned the same result with and without escaping the forward slash

提交回复
热议问题