[
https://issues.apache.org/jira/browse/OAK-3407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15031509#comment-15031509
]
Tommaso Teofili edited comment on OAK-3407 at 11/30/15 9:01 AM:
----------------------------------------------------------------
current ACL check with
{code}
Collection<String> indexedFields =
MultiFields.getIndexedFields(searcher.getIndexReader());
QueryParser qp = new
MultiFieldQueryParser(Version.LUCENE_47, indexedFields.toArray(new
String[indexedFields.size()]), indexNode.getDefinition().getAnalyzer());
{code}
is prone to runtime errors when there're lots of indexed fields.
{nocode}
org.apache.lucene.queryparser.classic.ParseException: Cannot parse ...: too
many boolean clauses
{nocode}
While that was introduced to solve the issue when _:suggest_ field has to be
used to perform ACL check, it was actually suboptimal.
Matching should be done using the correct analyzer on the _:suggest_ field,
depending on the {{defintion.isSuggestAnalyzed}} property.
The fix should be the following:
{code}
QueryParser qp = new QueryParser(Version.LUCENE_47, FieldNames.SUGGEST,
indexNode.getDefinition().isSuggestAnalyzed() ?
indexNode.getDefinition().getAnalyzer() :
SuggestHelper.getAnalyzer());
{code}
was (Author: teofili):
current ACL check with
{code}
Collection<String> indexedFields =
MultiFields.getIndexedFields(searcher.getIndexReader());
QueryParser qp = new
MultiFieldQueryParser(Version.LUCENE_47, indexedFields.toArray(new
String[indexedFields.size()]), indexNode.getDefinition().getAnalyzer());
{code}
is prone to runtime errors when there're lots of indexed fields.
{nocode}
org.apache.lucene.queryparser.classic.ParseException: Cannot parse ...: too
many boolean clauses
{nocde}
While that was introduced to solve the issue when _:suggest_ field has to be
used to perform ACL check, it was actually suboptimal.
Matching should be done using the correct analyzer on the _:suggest_ field,
depending on the {{defintion.isSuggestAnalyzed}} property.
The fix should be the following:
{code}
QueryParser qp = new QueryParser(Version.LUCENE_47, FieldNames.SUGGEST,
indexNode.getDefinition().isSuggestAnalyzed() ?
indexNode.getDefinition().getAnalyzer() :
SuggestHelper.getAnalyzer());
{code}
> Configuration to pass suggestion fields through analyzer
> --------------------------------------------------------
>
> Key: OAK-3407
> URL: https://issues.apache.org/jira/browse/OAK-3407
> Project: Jackrabbit Oak
> Issue Type: Improvement
> Components: lucene
> Reporter: Vikas Saurabh
> Assignee: Tommaso Teofili
> Priority: Minor
> Fix For: 1.3.12
>
> Attachments: OAK-3407.0.patch
>
>
> Currently, suggested phrases are fairly long. e.g. form {{SuggestTest}} with
> nodes containing {{in 2015 my fox is red, like mike's fox and john's fox}}
> and {{in 2015 a red fox is still a fox}} a suggest query for {{in 201}} the
> result would contain 2 suggestions (both the phrase independently).
> We should probably allow passing suggestion field thorough analyzer so that
> word level suggestions are possible. Moreover, that would also for suggestion
> to be available from middle of phrases e.g. suggestions for {{ite}} should
> give suggestion as {{item}} which, in turn, can search documents containing
> {{this is the most important item in the whole agenda}}.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)