Solr
  1. Solr
  2. SOLR-2703

Add support for the Lucene Surround Parser

    Details

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

      Description

      The Lucene/contrib surround parser provides support for span queries. This issue adds a Solr plugin for this parser

      1. SOLR-2703.patch
        4 kB
        Simon Rosenthal
      2. SOLR-2703.patch
        8 kB
        Simon Rosenthal
      3. SOLR-2703.patch
        44 kB
        Simon Rosenthal

        Issue Links

          Activity

          Hide
          Simon Rosenthal added a comment - - edited

          The most recent LUCENE-2945 patch is needed so that surround queries can be properly cached

          Show
          Simon Rosenthal added a comment - - edited The most recent LUCENE-2945 patch is needed so that surround queries can be properly cached
          Hide
          Simon Rosenthal added a comment -

          initial patch. No tests yet.

          Show
          Simon Rosenthal added a comment - initial patch. No tests yet.
          Hide
          Erik Hatcher added a comment -

          Nice start, Simon!

          Besides tests, we should probably make the maxBasicQueries a parameter too.

          One issue that rears its ugly head here, unfortunately, is that the Surround parser does not analyze any of the terms thus stemming at indexing time will cause confusion/problems in trying to use this parser by most folks, I'd presume. I don't consider lack of analysis a blocker for committing this integration, but a further issue probably should be opened to add analysis capabilities for non-wildcard terms in the query expression somehow.

          Show
          Erik Hatcher added a comment - Nice start, Simon! Besides tests, we should probably make the maxBasicQueries a parameter too. One issue that rears its ugly head here, unfortunately, is that the Surround parser does not analyze any of the terms thus stemming at indexing time will cause confusion/problems in trying to use this parser by most folks, I'd presume. I don't consider lack of analysis a blocker for committing this integration, but a further issue probably should be opened to add analysis capabilities for non-wildcard terms in the query expression somehow.
          Hide
          Simon Rosenthal added a comment -

          +1 on eventually adding analysis support to the parser.

          The default (1024) for maxBasicQueries seems more than adequate but it wouldn't hurt to have it as a parameter.

          I found that a field simply analyzed with lowercasing and the EnglishPluralStemmer gave decent results, and wildcard searches using the base form of the term will mostly compensate for lack of stemming support - all this can be documented in the javadocs and the Wiki.

          Show
          Simon Rosenthal added a comment - +1 on eventually adding analysis support to the parser. The default (1024) for maxBasicQueries seems more than adequate but it wouldn't hurt to have it as a parameter. I found that a field simply analyzed with lowercasing and the EnglishPluralStemmer gave decent results, and wildcard searches using the base form of the term will mostly compensate for lack of stemming support - all this can be documented in the javadocs and the Wiki.
          Hide
          Simon Rosenthal added a comment -

          Updated patch - adds a test suite, support for configuring maxBasicQueries in the URL, and configureing as one of the default parsers

          Show
          Simon Rosenthal added a comment - Updated patch - adds a test suite, support for configuring maxBasicQueries in the URL, and configureing as one of the default parsers
          Hide
          Erik Hatcher added a comment -

          I got beat up on this about the Velocity dependency in Core, so I'm now weary of adding this query parser as a built-in "surround" registered parser since it'll add a run-time dependency on an additional JAR file.

          Simon - cool to remove this auto-registration and we just wire it into Solr's example configuration? (once we get the test dependency on the example configuration trimmed out)

          Show
          Erik Hatcher added a comment - I got beat up on this about the Velocity dependency in Core, so I'm now weary of adding this query parser as a built-in "surround" registered parser since it'll add a run-time dependency on an additional JAR file. Simon - cool to remove this auto-registration and we just wire it into Solr's example configuration? (once we get the test dependency on the example configuration trimmed out)
          Hide
          Simon Rosenthal added a comment -

          New patch. Query parser not registered by default, and a commented out entry in example solrconfig was added.

          Hopefully ready to commit

          Show
          Simon Rosenthal added a comment - New patch. Query parser not registered by default, and a commented out entry in example solrconfig was added. Hopefully ready to commit
          Hide
          Simon Rosenthal added a comment -
          Show
          Simon Rosenthal added a comment - Wiki page to follow at http://wiki.apache.org/solr/SurroundQueryParser
          Hide
          Simon Rosenthal added a comment -

          Should hold up on the commit until https://issues.apache.org/jira/browse/LUCENE-2945 patch has been committed, otherwise query caching is very broken. I updated the patch for that issue to work with trunk a few weeks ago.

          Show
          Simon Rosenthal added a comment - Should hold up on the commit until https://issues.apache.org/jira/browse/LUCENE-2945 patch has been committed, otherwise query caching is very broken. I updated the patch for that issue to work with trunk a few weeks ago.
          Hide
          Erik Hatcher added a comment -

          Simon - thanks for the work on this. I went back and changed the query parser to be automatically registered... I was thinking that we'd need to ship another JAR to get this to work, but we already include Lucene's queryparser JAR so might as well pre-register this parser. That eliminated the need for the solrconfigsurround.xml in the test as well, so I removed that.

          Show
          Erik Hatcher added a comment - Simon - thanks for the work on this. I went back and changed the query parser to be automatically registered... I was thinking that we'd need to ship another JAR to get this to work, but we already include Lucene's queryparser JAR so might as well pre-register this parser. That eliminated the need for the solrconfigsurround.xml in the test as well, so I removed that.
          Hide
          Rahul Mehta added a comment - - edited

          Please tell how to install this patch. on solr 3.1

          Show
          Rahul Mehta added a comment - - edited Please tell how to install this patch. on solr 3.1
          Hide
          Erick Erickson added a comment -

          Rahul:

          See: http://wiki.apache.org/solr/HowToContribute for how to apply patches. However, this patch is for the trunk code line and it may not apply to 3.1. In fact I'd be surprised if it did without some work, although I haven't looked at it...

          Note that these are source-code patches, you have to apply them, compile (ant dist example etc) and take responsibility for doing the right thing with the results.

          Show
          Erick Erickson added a comment - Rahul: See: http://wiki.apache.org/solr/HowToContribute for how to apply patches. However, this patch is for the trunk code line and it may not apply to 3.1. In fact I'd be surprised if it did without some work, although I haven't looked at it... Note that these are source-code patches, you have to apply them, compile (ant dist example etc) and take responsibility for doing the right thing with the results.
          Hide
          Jason added a comment -

          Doesn't support range query?

          Show
          Jason added a comment - Doesn't support range query?
          Hide
          abhimanyu added a comment -

          highlighter component does not work with surround parser , are there any plugin or patches available to highlight the result set returned by using surround parser or by using surround defType.

          Show
          abhimanyu added a comment - highlighter component does not work with surround parser , are there any plugin or patches available to highlight the result set returned by using surround parser or by using surround defType.
          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??

            People

            • Assignee:
              Erik Hatcher
              Reporter:
              Simon Rosenthal
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development