4
votes

I have an indexed, stored Boolean field that I'm trying to use as a filter:

<field name="is_instrumental" type="boolean" indexed="true" stored="true" />

However, when I try to use it as a fq parameter, the query returns zero results:

select?q=*:*&fq=is_instrumental:true&wt=xml&indent=true

<response>
  <lst name="responseHeader">
    <int name="status">0</int>
    <int name="QTime">0</int>
    <lst name="params">
      <str name="indent">true</str>
      <str name="q">*:*</str>
      <str name="wt">xml</str>
      <str name="fq">is_instrumental:true</str>
    </lst>
  </lst>
  <result name="response" numFound="0" start="0"></result>
</response>

I've tried every combination I can think of (true, false, 1, 0, TRUE, FALSE, also in quotes), no matter what I try it doesn't return anything. Filters on other fields (ints or strings) work perfectly fine. Using Solr 4.1.

What am I missing?

Edit:

solrconfig.xml: http://pastebin.com/kGWhQBma

schema.xml: http://pastebin.com/uqnYuuHR

1
Have you checked to ensure that the is_instrumental field is being correctly populated for each item in the index? - Paige Cook
As far as I can tell, yes - I see things like <bool name="is_instrumental">false</bool> (or true) in the result when I make a normal query. - alex_c
what data are you feeding into the Boolean field ?? - Jayendra

1 Answers

2
votes

There is nothing wrong with your query syntax &fq=is_instrumental:true should work.

My guess here is that you are using a customized version of the /select request handler that is implementing a custom query parser like the eDisMax (Extended Dismax) Parser. Perhaps the &uf parameter has been set to prevent fielded searches. Can you check your solrconfig.xml and see how the defaults for the <requestHandler name="/select" class="solr.SearchHandler"> configuration are defined?