Solr Query not parsing forward slash

前端 未结 3 1624
悲哀的现实
悲哀的现实 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:28

    I just came across the same problem, and after some experimentation found that if you have a forward-slash in the field name, you must escape it with a backslash in the Solr query (but note that you do not have to do this in the field list parameter, so a search looking for /my/field/name containing my_value is entered in the "q" field as:

    \/my\/field\/name:my_value

    I haven't tried the sort field, but try this and let us know :)

    This is on Solr 4.0.0 alpha.

提交回复
热议问题