zelinka
zelinka

Reputation: 3413

Solr fq not eliminating results

I am issuing the following query:

  "responseHeader": {
    "status": 0,
    "QTime": 1,
    "params": {
      "q": "(test)",
      "defType": "edismax",
      "indent": "true",
      "fl": "distributor_status,QOH_estimate,id,score",
      "start": "0",
      "sort": "score desc,id desc",
      "fq": "(QOH_estimate:[1 TO *])+OR+(distributor_status:stock)+OR+(*:* -distributor_status:VENDORDISC)",
      "rows": "10",
      "wt": "json",
      "_": "1446833368873"
    }
  }

I am getting back documents like the following:

  {  "id": "5445a000e4b0fb20ffca4aba",
    "QOH_estimate": 0,
    "distributor_status": "VENDORDISC",
    "score": 4.48295
  }

How does this document get past the fq?

Its QOH_estimate is 0, so it fails the QOH_estimate:[1 TO *]. Its distributor_status is VENDORDISC, so it fails distribotor_status:stock. Its distributor_status is VENDORDISC, so I would also expect it to fail the (*:* -distributor_status:VENDORDISC) as well. Since it fails all 3 parts of the disjunctive query, I would expect it to be eliminated, yet it is not being eliminated. Why?

Upvotes: 0

Views: 63

Answers (1)

Alexandre Rafalovitch
Alexandre Rafalovitch

Reputation: 9789

I think your spaces between the clauses are double-escaping. Why otherwise, you have +OR+ in that output when the other spaces are fine.

If that does not help, try adding debug flag and see how that all gets parsed into the Lucene level. That should give a hint to the final expansion.

Upvotes: 1

Related Questions