Solr
  1. Solr
  2. SOLR-3060

add highlighter support to SurroundQParserPlugin

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 4.0-ALPHA
    • Fix Version/s: 4.2, Trunk
    • Component/s: search
    • Labels:
      None

      Description

      Highlighter does not recognize SrndQuery family.
      http://search-lucene.com/m/FuDsU1sTjgM
      http://search-lucene.com/m/wD8c11gNTb61

      1. SOLR-3060.patch
        5 kB
        Ahmet Arslan
      2. SOLR-3060.patch
        3 kB
        Ahmet Arslan
      3. SOLR-3060.patch
        1 kB
        Ahmet Arslan

        Issue Links

          Activity

          Hide
          Ahmet Arslan added a comment -

          o.a.s.search.QParser#getHighlightQuery() method is overridden.

          Show
          Ahmet Arslan added a comment - o.a.s.search.QParser#getHighlightQuery() method is overridden.
          Hide
          Ahmet Arslan added a comment -

          some test added

          Show
          Ahmet Arslan added a comment - some test added
          Hide
          abhimanyu added a comment -

          thanks for your patch but i am not able to apply this patch ,i am not using any svn version , please tell me how to apply this patch.

          Show
          abhimanyu added a comment - thanks for your patch but i am not able to apply this patch ,i am not using any svn version , please tell me how to apply this patch.
          Hide
          abhimanyu added a comment -

          i am using patch -p0 -i SOLR-3060.patch --dry-run as mentioned in the docs , but error is coming that not a correct p option,plz tell me how to use ur patch

          Show
          abhimanyu added a comment - i am using patch -p0 -i SOLR-3060 .patch --dry-run as mentioned in the docs , but error is coming that not a correct p option,plz tell me how to use ur patch
          Hide
          Shalu Singh added a comment -

          i am facing the same problem. Donno how to apply the SOLR-3060.patch

          Show
          Shalu Singh added a comment - i am facing the same problem. Donno how to apply the SOLR-3060 .patch
          Hide
          Ahmet Arslan added a comment -

          The following commands should do it.

          Use newly created trunk/solr/dist/apache-solr-4.0-SNAPSHOT.war file.

          Show
          Ahmet Arslan added a comment - The following commands should do it. svn checkout http://svn.apache.org/repos/asf/lucene/dev/trunk cd trunk curl -O https://issues.apache.org/jira/secure/attachment/12511843/SOLR-3060.patch patch -p0 -i SOLR-3060 .patch cd solr ant clean dist Use newly created trunk/solr/dist/apache-solr-4.0-SNAPSHOT.war file.
          Hide
          Hoss Man added a comment -

          This patch is straight forward and includes tests (thank you so much for the tests).

          The meat of the change is that getHighlightQuery is overridden to attempt query rewriting, which gives me two concerns...

          1) at a minimum i'm pretty sure super.getHighlightQuery still needs to be called.

          2) is this rewriting of hte query done in the SurroundQParser going to cause any problems or unexpected behavior in conjunction with the highlighter component logic that already decides if/when to rewrite the query?

          If the crux of the problem is that HighlightComponent rewrites the query automatically except when using the phrase highlighter with the multi-term option (assuming i'm reading the code correctly) then shouldn't that code path of the highlighter be modified to do something sane with any type of Query object? ... why isn't it responsible for calling rewrite on any sub-query of a type it doesn't understanding?

          (Highlighting is one of the areas of Lucene/Solr that frequently makes my head hurt, so forgive me if these are silly questions)

          Show
          Hoss Man added a comment - This patch is straight forward and includes tests (thank you so much for the tests). The meat of the change is that getHighlightQuery is overridden to attempt query rewriting, which gives me two concerns... 1) at a minimum i'm pretty sure super.getHighlightQuery still needs to be called. 2) is this rewriting of hte query done in the SurroundQParser going to cause any problems or unexpected behavior in conjunction with the highlighter component logic that already decides if/when to rewrite the query? If the crux of the problem is that HighlightComponent rewrites the query automatically except when using the phrase highlighter with the multi-term option (assuming i'm reading the code correctly) then shouldn't that code path of the highlighter be modified to do something sane with any type of Query object? ... why isn't it responsible for calling rewrite on any sub-query of a type it doesn't understanding? (Highlighting is one of the areas of Lucene/Solr that frequently makes my head hurt, so forgive me if these are silly questions)
          Hide
          Shalu Singh added a comment -

          Thanks for your support and quick reply and resolving my problem. It is giving desirable results now.

          Show
          Shalu Singh added a comment - Thanks for your support and quick reply and resolving my problem. It is giving desirable results now.
          Hide
          abhimanyu added a comment - - edited

          thanks for ur support in resolving this problem,however i was facing another problem with highlighter while using it with numeric field types as it does not return the highlighted results. i have posted it in jira issues but have not found any help regarding it , any suggestion would be of great help.
          Please follow the link

          https://issues.apache.org/jira/browse/SOLR-3050

          Show
          abhimanyu added a comment - - edited thanks for ur support in resolving this problem,however i was facing another problem with highlighter while using it with numeric field types as it does not return the highlighted results. i have posted it in jira issues but have not found any help regarding it , any suggestion would be of great help. Please follow the link https://issues.apache.org/jira/browse/SOLR-3050
          Hide
          Shalu Singh added a comment -

          Hi Ahmet, i am trying to include the SOLR-2703.patch into SOLR 3.5 downloaded from SVN branches to provide Surround parser. But it is not working after including the 2703 SOLR patch. Do u know how to apply the same??

          Show
          Shalu Singh added a comment - Hi Ahmet, i am trying to include the SOLR-2703 .patch into SOLR 3.5 downloaded from SVN branches to provide Surround parser. But it is not working after including the 2703 SOLR patch. Do u know how to apply the same??
          Hide
          Ahmet Arslan added a comment -

          ... why isn't it responsible for calling rewrite on any sub-query of a type it doesn't understanding?

          Unknown and not explicitly mapped queries are now rewritten against the highlighting IndexReader to obtain primitive queries before discarding the query entirely.

          As Hoss said this problem fixed at Highlighter level in LUCENE-4728. Test case passes now.

          Show
          Ahmet Arslan added a comment - ... why isn't it responsible for calling rewrite on any sub-query of a type it doesn't understanding? Unknown and not explicitly mapped queries are now rewritten against the highlighting IndexReader to obtain primitive queries before discarding the query entirely. As Hoss said this problem fixed at Highlighter level in LUCENE-4728 . Test case passes now.
          Hide
          Ahmet Arslan added a comment -

          Test case only patch. Test passes now without modification to SurroundQParserPlugin.java

          Show
          Ahmet Arslan added a comment - Test case only patch. Test passes now without modification to SurroundQParserPlugin.java
          Hide
          Ahmet Arslan added a comment - - edited

          This particular issue was addressed in LUCENE-4728, what is the proper way to close this issue? Any interest to include test case?

          Show
          Ahmet Arslan added a comment - - edited This particular issue was addressed in LUCENE-4728 , what is the proper way to close this issue? Any interest to include test case?
          Hide
          Hoss Man added a comment -

          Ahmet: thanks for your patch and your persistence – it's definitely handy to have more tests like this to help ensure things don't regress...

          Committed revision 1448863.
          Committed revision 1448864.

          Show
          Hoss Man added a comment - Ahmet: thanks for your patch and your persistence – it's definitely handy to have more tests like this to help ensure things don't regress... Committed revision 1448863. Committed revision 1448864.
          Hide
          Commit Tag Bot added a comment -

          [trunk commit] Chris M. Hostetter
          http://svn.apache.org/viewvc?view=revision&revision=1448863

          SOLR-3060: SurroundQParserPlugin highlighting tests

          Show
          Commit Tag Bot added a comment - [trunk commit] Chris M. Hostetter http://svn.apache.org/viewvc?view=revision&revision=1448863 SOLR-3060 : SurroundQParserPlugin highlighting tests
          Hide
          Commit Tag Bot added a comment -

          [branch_4x commit] Chris M. Hostetter
          http://svn.apache.org/viewvc?view=revision&revision=1448864

          SOLR-3060: SurroundQParserPlugin highlighting tests (merge r1448863)

          Show
          Commit Tag Bot added a comment - [branch_4x commit] Chris M. Hostetter http://svn.apache.org/viewvc?view=revision&revision=1448864 SOLR-3060 : SurroundQParserPlugin highlighting tests (merge r1448863)
          Hide
          Uwe Schindler added a comment -

          Closed after release.

          Show
          Uwe Schindler added a comment - Closed after release.

            People

            • Assignee:
              Ahmet Arslan
              Reporter:
              Ahmet Arslan
            • Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development