Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.0-ALPHA
    • Component/s: None
    • Labels:
      None

      Description

      Add function queries for relevancy factors such as tf, idf, etc.

      1. SOLR-1932_sumtotaltermfreq.patch
        3 kB
        Yonik Seeley
      2. SOLR-1932_totaltermfreq.patch
        5 kB
        Yonik Seeley
      3. SOLR-1932.patch
        28 kB
        Yonik Seeley

        Activity

        Hide
        Yonik Seeley added a comment -

        Half for fun, this is a draft (no tests, etc) that implements

        • docfreq(field,val)
        • termfreq(field,val)
        • idf(field,val)
        • tf(field,val)
        • norm(field)
        • maxdoc()
        • numdocs()

        Example:

        http://localhost:8983/solr/select?defType=func&fl=id,score&debugQuery=true&q=termfreq(text,solr)

        The field name and field value currently don't need to be quoted, but may be. Param dereferencing should also be supported, but I haven't tested it.

        The usefulness of these could grow when one considers new features such as sort-by-function, and not yet implemented pseudo-fields (returning function query values for every doc in a result).

        Show
        Yonik Seeley added a comment - Half for fun, this is a draft (no tests, etc) that implements docfreq(field,val) termfreq(field,val) idf(field,val) tf(field,val) norm(field) maxdoc() numdocs() Example: http://localhost:8983/solr/select?defType=func&fl=id,score&debugQuery=true&q=termfreq(text,solr ) The field name and field value currently don't need to be quoted, but may be. Param dereferencing should also be supported, but I haven't tested it. The usefulness of these could grow when one considers new features such as sort-by-function, and not yet implemented pseudo-fields (returning function query values for every doc in a result).
        Hide
        Yonik Seeley added a comment -

        added tests and committed.

        TODO: still needs documentation, after we figure out how to do that across all of the releases we now have.

        Show
        Yonik Seeley added a comment - added tests and committed. TODO: still needs documentation, after we figure out how to do that across all of the releases we now have.
        Hide
        Yonik Seeley added a comment -

        Here's an update with one of the relevancy functions I missed: totaltermfreq.

        Show
        Yonik Seeley added a comment - Here's an update with one of the relevancy functions I missed: totaltermfreq.
        Hide
        Robert Muir added a comment -

        maybe add Terms.getSumTotalTermFreq (aka #tokens in field) too? usually if you use total term freq you also want #tokens as the denominator

        Show
        Robert Muir added a comment - maybe add Terms.getSumTotalTermFreq (aka #tokens in field) too? usually if you use total term freq you also want #tokens as the denominator
        Hide
        Yonik Seeley added a comment -

        Hmm, yeah, I didn't even know about Terms.getSumTotalTermFreq!

        Show
        Yonik Seeley added a comment - Hmm, yeah, I didn't even know about Terms.getSumTotalTermFreq!
        Hide
        Yonik Seeley added a comment -

        Here's an update that includes sumtotaltermfreq and aliases
        totaltermfreq to ttf and sumtotaltermfreq to sttf.

        Show
        Yonik Seeley added a comment - Here's an update that includes sumtotaltermfreq and aliases totaltermfreq to ttf and sumtotaltermfreq to sttf.

          People

          • Assignee:
            Unassigned
            Reporter:
            Yonik Seeley
          • Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development