[ https://issues.apache.org/jira/browse/SOLR-1980?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13000249#comment-13000249 ]

Jan Høydahl commented on SOLR-1980:

I have tried to implement this as a CharFilter and it works pretty well.

The problem I face is that inserting extra bytes at the beginning and end of the charstream does not play well with highlighting. I get an error:

org.apache.solr.common.SolrException: org.apache.lucene.search.highlight.InvalidTokenOffsetsException: Token card exceeds length of provided text sized 43
at org.apache.solr.highlight.DefaultSolrHighlighter.doHighlightingByHighlighter(DefaultSolrHighlighter.java:473)
at org.apache.solr.highlight.DefaultSolrHighlighter.doHighlighting(DefaultSolrHighlighter.java:378)
at org.apache.solr.handler.component.HighlightComponent.process(HighlightComponent.java:121)

Implement boundary match support

Key: SOLR-1980
URL: https://issues.apache.org/jira/browse/SOLR-1980
Project: Solr
Issue Type: New Feature
Components: Schema and Analysis
Reporter: Jan Høydahl

Sometimes you need to specify that a query should match only at the start or end of a field, or be an exact match.
Example content:
1) a quick fox is brown
2) quick fox is brown
Example queries:
"^quick fox" -> should only match 2)
"brown$" -> should match 1) and 2)
"^quick fox is brown$" -> should only match 2)
Proposed way of implmementation is through a new BoundaryMatchTokenFilter which behaves like this:
On the index side it inserts special unique tokens at beginning and end of field. These could be some weird unicode sequence.
On the query side, it looks for the first character matching "^" or the last character matching "$" and replaces them with the special tokens.
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdev @
postedFeb 28, '11 at 11:59a
activeFeb 28, '11 at 11:59a

1 user in discussion

Jan Høydahl (JIRA): 1 post



site design / logo © 2021 Grokbase