Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1013173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:03:35+00:00 2026-05-16T10:03:35+00:00

I’m trying to query Solr for entries that either have a certain value in

  • 0

I’m trying to query Solr for entries that either have a certain value in a field OR no value for the field. The negated field value works when used by itself but causes the query to return no results when combined with anything else. Below is a response with debugQuery enabled. The config file I use can be found here.

<?xml version="1.0"?>
<response>
  <responseHeader>
    <status>0</status>
    <QTime>3</QTime>
    <lst name="params">
      <str name="facet">true</str>
      <str name="sort">sort_title asc</str>
      <str name="fl">id,nid,url,uid</str>
      <str name="debugQuery">true</str>
      <str name="facet.mincount">1</str>
      <str name="facet.sort">true</str>
      <str name="start">0</str>
      <str name="bf">recip(rord(created),4.000000,239,239)^200.000000</str>
      <arr name="fq">
        <str>NOT type:article</str>
        <str>NOT type:insect</str>
        <str>NOT type:news</str>
        <str>NOT type:plant</str>
        <str>im_cck_field_affected_plants:(20 OR -[* TO *])</str>
        <str>entity:node</str>
      </arr>
      <str name="version">1.2</str>
      <str name="rows">16</str>
    </lst>
  </responseHeader>
  <result name="response" numFound="0" start="0"/>
  <lst name="facet_counts">
    <lst name="facet_queries"/>
    <lst name="facet_fields"/>
    <lst name="facet_dates"/>
  </lst>
  <lst name="debug">
    <null name="rawquerystring"/>
    <null name="querystring"/>
    <str name="parsedquery">+MatchAllDocsQuery(*:*) FunctionQuery((239.0/(4.0*float(top(rord(created)))+239.0))^200.0)</str>
    <str name="parsedquery_toString">+*:* (239.0/(4.0*float(top(rord(created)))+239.0))^200.0</str>
    <lst name="explain"/>
    <str name="QParser">DisMaxQParser</str>
    <str name="altquerystring">org.apache.lucene.search.MatchAllDocsQuery:*:*</str>
    <arr name="boostfuncs">
      <str>recip(rord(created),4.000000,239,239)^200.000000</str>
    </arr>
    <arr name="filter_queries">
      <str>NOT type:article</str>
      <str>NOT type:insect</str>
      <str>NOT type:news</str>
      <str>NOT type:plant</str>
      <str>im_cck_field_affected_plants:(20 OR -[* TO *])</str>
      <str>entity:node</str>
    </arr>
    <arr name="parsed_filter_queries">
      <str>-type:article</str>
      <str>-type:insect</str>
      <str>-type:news</str>
      <str>-type:plant</str>
      <str>im_cck_field_affected_plants:20 -im_cck_field_affected_plants:[* TO *]</str>
      <str>entity:node</str>
    </arr>
    <lst name="timing">
      <double name="time">3.0</double>
      <lst name="prepare">
        <double name="time">3.0</double>
        <lst name="org.apache.solr.handler.component.QueryComponent">
          <double name="time">2.0</double>
        </lst>
        <lst name="org.apache.solr.handler.component.FacetComponent">
          <double name="time">0.0</double>
        </lst>
        <lst name="org.apache.solr.handler.component.MoreLikeThisComponent">
          <double name="time">0.0</double>
        </lst>
        <lst name="org.apache.solr.handler.component.HighlightComponent">
          <double name="time">0.0</double>
        </lst>
        <lst name="org.apache.solr.handler.component.StatsComponent">
          <double name="time">0.0</double>
        </lst>
        <lst name="org.apache.solr.handler.component.SpellCheckComponent">
          <double name="time">0.0</double>
        </lst>
        <lst name="org.apache.solr.handler.component.DebugComponent">
          <double name="time">0.0</double>
        </lst>
      </lst>
      <lst name="process">
        <double name="time">0.0</double>
        <lst name="org.apache.solr.handler.component.QueryComponent">
          <double name="time">0.0</double>
        </lst>
        <lst name="org.apache.solr.handler.component.FacetComponent">
          <double name="time">0.0</double>
        </lst>
        <lst name="org.apache.solr.handler.component.MoreLikeThisComponent">
          <double name="time">0.0</double>
        </lst>
        <lst name="org.apache.solr.handler.component.HighlightComponent">
          <double name="time">0.0</double>
        </lst>
        <lst name="org.apache.solr.handler.component.StatsComponent">
          <double name="time">0.0</double>
        </lst>
        <lst name="org.apache.solr.handler.component.SpellCheckComponent">
          <double name="time">0.0</double>
        </lst>
        <lst name="org.apache.solr.handler.component.DebugComponent">
          <double name="time">0.0</double>
        </lst>
      </lst>
    </lst>
  </lst>
</response>

Any help would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T10:03:36+00:00Added an answer on May 16, 2026 at 10:03 am

    Finally phrased the question well enough to find an answer through Google.

    http://osdir.com/ml/solr-user.lucene.apache.org/2009-03/msg00480.html

    OR NOT queries can be written as, using my case as an example:

    im_cck_field_affected_plants:20 OR (*:* -im_cck_field_affected_plants:[* TO *])
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am trying to loop through a bunch of documents I have to put
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I have a bunch of posts stored in text files formatted in yaml/textile (from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.