How to search in a multi-valued field in Solr?

I have results for doing a search in Solr. My Solr has a multi-valued field similar to this document below:

<int name="id">2166324592435</int>
...others fields
<arr name="Series">
   <str>The Walking Dead<\str>
   <str>Game of Thrones<\str>
<\arr>

The multi-valued Series field has the Tv series referenced by the document. In the example above, my document talks about The Walking Dead and Game of Thrones. I can have documents with one, two or more series, or even without series.

I want to search in Solr. I want to give the series that I want, and Solr should return the documents that speak of my request. I tried, but I could not do it. I tried the following:

q=series:The Walking Dead or series:Game of Thrones or ...&wt=json

I think I'm wrong. What is the right way to do this?

Thanks in advance

Thiago

+5
source share
5 answers

In addition to @ user1452132 the answer is -

q=series:The Walking Dead, the, walking dead - .

: OR: (Walking Dead)

debugQuery = on URL- .

Dismax, .

+2

- :
series:("The Walking Dead" OR "Game of Thrones")

+6

fq ( ),

    name:("Java" OR "Python")
    name:("Java" AND "Web")

    // multivalued fields
    author_ids:(1733 OR 58)
    author_ids:(1733 AND 58)

Solr url encoding:

  • ':' '% 3A'
  • space '+'

, URL:

http://localhost:8983/solr/xxx/select?q=programming&fq=title%3A ( "Java" + AND + "web" ) & wt = json & indent = true & defType = edismax & qf = & = & lowercaseOperators =

+2

,

series: "The Walking Dead" or series: "Spikes Game"

Series: (The Walking Dead) Series OR: (Game of Thorns)

Read solr request syntax and Lucene basic request syntax

+1
source

I think your actual problem is to use ORas lowercase. When you do something like this, the value ORis executed in defaultTextField. Also, do not forget to put quotation marks if there is a space in your request and you are looking for an exact match.

0
source

All Articles