Jackrabbit Oak
  1. Jackrabbit Oak
  2. OAK-336

Document query language extensions (SQL2 "measure", "explain")

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.7
    • Component/s: core
    • Labels:
      None

      Description

      I'm not sure what the purpose of the sql2 "measure" command is, we need some docs explaining what the value is expected to be/mean.

        Activity

        Hide
        Alex Parvulescu added a comment -

        changes with rev 1389360:

        • moved "measure" related tests to their own test file
        • removed the "score" query condition, you are not supposed to filter on it [0]

        [0] http://wiki.apache.org/lucene-java/LuceneFAQ#Can_I_filter_by_score.3F

        Show
        Alex Parvulescu added a comment - changes with rev 1389360: moved "measure" related tests to their own test file removed the "score" query condition, you are not supposed to filter on it [0] [0] http://wiki.apache.org/lucene-java/LuceneFAQ#Can_I_filter_by_score.3F
        Hide
        Thomas Mueller added a comment -

        > I'm not sure what the purpose of the sql2 "measure" command is

        It is used to measure how many nodes were read by a given query. This should help a developer to better understand how efficient the query is, because just measuring the time of the query is not meaningful if the nodes are cached.

        > removed the "score" query condition, you are not supposed to filter on it

        You refer to the Lucene documentation. But as far as I see, filtering on SCORE() is allowed according to the JCR grammar [1]. The JCR spec [2] says "Support for comparing jcr:score(...) in a predicate is not required." but I think it does make sense as to support it if we easily can. Is there a problem to support it?

        [1] http://www.h2database.com/jcr/grammar.html
        [2] http://www.day.com/specs/jcr/1.0/6.6.5.3_jcr_score_function.html

        Show
        Thomas Mueller added a comment - > I'm not sure what the purpose of the sql2 "measure" command is It is used to measure how many nodes were read by a given query. This should help a developer to better understand how efficient the query is, because just measuring the time of the query is not meaningful if the nodes are cached. > removed the "score" query condition, you are not supposed to filter on it You refer to the Lucene documentation. But as far as I see, filtering on SCORE() is allowed according to the JCR grammar [1] . The JCR spec [2] says "Support for comparing jcr:score(...) in a predicate is not required." but I think it does make sense as to support it if we easily can. Is there a problem to support it? [1] http://www.h2database.com/jcr/grammar.html [2] http://www.day.com/specs/jcr/1.0/6.6.5.3_jcr_score_function.html
        Hide
        Alex Parvulescu added a comment -

        The score comments only refer to this test, not to the global query engine.

        Filtering is allowed and we can implement it, I don't see the value of having that specific condition in the test as long as we can't control the output of the 'score' function. So what I did is I only removed the test condition that was referring to the score's value: "and score() >= 0.0".

        From the lucene docs:
        > You can always pick an arbitrary score value and then check the Hits object to see how many results have a score higher than that value (a Binary search might come in handy) but it really doesn't give you any meaningful information because of the way score is calculated

        From our oak code [0]:
        > // TODO if score() is not supported by the index, use the value 0.0?

        So as long as we don't know what the output is, what sense does it make to test against "0"?
        Also are there any test in jackrabbit that have where conditions based on the score output?

        [0] http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchScoreImpl.java?view=markup#l52

        Show
        Alex Parvulescu added a comment - The score comments only refer to this test, not to the global query engine. Filtering is allowed and we can implement it, I don't see the value of having that specific condition in the test as long as we can't control the output of the 'score' function. So what I did is I only removed the test condition that was referring to the score's value: "and score() >= 0.0". From the lucene docs: > You can always pick an arbitrary score value and then check the Hits object to see how many results have a score higher than that value (a Binary search might come in handy) but it really doesn't give you any meaningful information because of the way score is calculated From our oak code [0] : > // TODO if score() is not supported by the index, use the value 0.0? So as long as we don't know what the output is, what sense does it make to test against "0"? Also are there any test in jackrabbit that have where conditions based on the score output? [0] http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchScoreImpl.java?view=markup#l52
        Hide
        Michael Dürig added a comment -

        Cleaning up old issues. Please reopen if necessary. Consider opening a new issue for follow up work.

        Show
        Michael Dürig added a comment - Cleaning up old issues. Please reopen if necessary. Consider opening a new issue for follow up work.

          People

          • Assignee:
            Thomas Mueller
            Reporter:
            Alex Parvulescu
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development