Solr
  1. Solr
  2. SOLR-407

Uncached filter query parameters

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Duplicate
    • Affects Version/s: 1.3
    • Fix Version/s: 3.4, 4.0-ALPHA
    • Component/s: search
    • Labels:
      None

      Description

      Add a fq.nocache parameter (that may be specified multiple times) that adds filter clauses to the query which are not cached. Further, these filters are embedded directly into the BooleanQuery, which should be more efficient when filters are not reused.

        Activity

        Mike Klaas created issue -
        Hide
        Mike Klaas added a comment -

        To implement I exposed one method of QueryUtils (getAbs) so that negative filters can be added as prohibited clauses.

        Show
        Mike Klaas added a comment - To implement I exposed one method of QueryUtils (getAbs) so that negative filters can be added as prohibited clauses.
        Mike Klaas made changes -
        Field Original Value New Value
        Attachment fq.nocache.patch [ 12369067 ]
        Hide
        Hoss Man added a comment -

        Mike: one thing that's not clear to me from a quick glance at your patch is wether or not this case works...

        q= -foo & fq.nocache=bar

        ...i think that in your patch, a boolean query containing one negative foo clause gets added to a new "target" query as a mandatory clause along with the fq.nocache ... and the SolrIndexSearcher code for detecting a pure negative query and finding the inverse doesn't get tripped.

        Show
        Hoss Man added a comment - Mike: one thing that's not clear to me from a quick glance at your patch is wether or not this case works... q= -foo & fq.nocache=bar ...i think that in your patch, a boolean query containing one negative foo clause gets added to a new "target" query as a mandatory clause along with the fq.nocache ... and the SolrIndexSearcher code for detecting a pure negative query and finding the inverse doesn't get tripped.
        Hide
        Mike Klaas added a comment -

        Good catch! This can be fixed in standard request handler as follows:

        if(null != ncFilters) {
        BooleanQuery target;
        if(query instanceof BooleanQuery)

        { target = (BooleanQuery)query; }

        else

        { target = new BooleanQuery(true); target.add(query, BooleanClause.Occur.MUST); }

        U.addFilters(ncFilters, target);
        query = target;
        }

        DisMax I don't think is a problem since it is adding to the top-level boolean query (can the dismax parser produce pure negative queries anyway?)

        I've fixed this with a test in my local copy. If we pursue this any further, I'll post a patch (also incorporating Yonik's localParams suggestion).

        Show
        Mike Klaas added a comment - Good catch! This can be fixed in standard request handler as follows: if(null != ncFilters) { BooleanQuery target; if(query instanceof BooleanQuery) { target = (BooleanQuery)query; } else { target = new BooleanQuery(true); target.add(query, BooleanClause.Occur.MUST); } U.addFilters(ncFilters, target); query = target; } DisMax I don't think is a problem since it is adding to the top-level boolean query (can the dismax parser produce pure negative queries anyway?) I've fixed this with a test in my local copy. If we pursue this any further, I'll post a patch (also incorporating Yonik's localParams suggestion).
        Mike Klaas made changes -
        Fix Version/s 1.3 [ 12312486 ]
        Hide
        Erik Hatcher added a comment -

        on my wishlist, targeting this for 1.5

        Show
        Erik Hatcher added a comment - on my wishlist, targeting this for 1.5
        Erik Hatcher made changes -
        Fix Version/s 1.5 [ 12313566 ]
        Hide
        Hoss Man added a comment -

        Bulk updating 240 Solr issues to set the Fix Version to "next" per the process outlined in this email...

        http://mail-archives.apache.org/mod_mbox/lucene-dev/201005.mbox/%3Calpine.DEB.1.10.1005251052040.24672@radix.cryptio.net%3E

        Selection criteria was "Unresolved" with a Fix Version of 1.5, 1.6, 3.1, or 4.0. email notifications were suppressed.

        A unique token for finding these 240 issues in the future: hossversioncleanup20100527

        Show
        Hoss Man added a comment - Bulk updating 240 Solr issues to set the Fix Version to "next" per the process outlined in this email... http://mail-archives.apache.org/mod_mbox/lucene-dev/201005.mbox/%3Calpine.DEB.1.10.1005251052040.24672@radix.cryptio.net%3E Selection criteria was "Unresolved" with a Fix Version of 1.5, 1.6, 3.1, or 4.0. email notifications were suppressed. A unique token for finding these 240 issues in the future: hossversioncleanup20100527
        Hoss Man made changes -
        Fix Version/s Next [ 12315093 ]
        Fix Version/s 1.5 [ 12313566 ]
        Hoss Man made changes -
        Fix Version/s 3.2 [ 12316172 ]
        Fix Version/s Next [ 12315093 ]
        Hide
        Robert Muir added a comment -

        Bulk move 3.2 -> 3.3

        Show
        Robert Muir added a comment - Bulk move 3.2 -> 3.3
        Robert Muir made changes -
        Fix Version/s 3.3 [ 12316471 ]
        Fix Version/s 3.2 [ 12316172 ]
        Robert Muir made changes -
        Fix Version/s 3.4 [ 12316683 ]
        Fix Version/s 4.0 [ 12314992 ]
        Fix Version/s 3.3 [ 12316471 ]
        Hide
        Robert Muir added a comment -

        3.4 -> 3.5

        Show
        Robert Muir added a comment - 3.4 -> 3.5
        Robert Muir made changes -
        Fix Version/s 3.5 [ 12317876 ]
        Fix Version/s 3.4 [ 12316683 ]
        Simon Willnauer made changes -
        Fix Version/s 3.6 [ 12319065 ]
        Fix Version/s 3.5 [ 12317876 ]
        Hide
        Koji Sekiguchi added a comment -

        Looks like it's been implemented as local parameter

        {!cache=false}

        .

        Show
        Koji Sekiguchi added a comment - Looks like it's been implemented as local parameter {!cache=false} .
        Hide
        Koji Sekiguchi added a comment -

        It's SOLR-2429. Resolved as duplicate.

        Show
        Koji Sekiguchi added a comment - It's SOLR-2429 . Resolved as duplicate.
        Koji Sekiguchi made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Mike Klaas [ klaasm ] Koji Sekiguchi [ koji ]
        Fix Version/s 3.4 [ 12316683 ]
        Fix Version/s 3.6 [ 12319065 ]
        Resolution Duplicate [ 3 ]
        Uwe Schindler made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        1573d 5h 46m 1 Koji Sekiguchi 27/Feb/12 06:27
        Resolved Resolved Closed Closed
        438d 4h 11m 1 Uwe Schindler 10/May/13 11:39

          People

          • Assignee:
            Koji Sekiguchi
            Reporter:
            Mike Klaas
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development