apache / apache/lucene

Allow ability to set maxDocCharsToAnalyze in WeightedSpanTermExtractor [LUCENE-3287]

Open
#4,360 0 comments 0 reactions 0 assignees View on GitHub
affects-version:3.3 legacy-jira-priority:Trivial module:highlighter type:enhancement
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

Spinoff from this thread:

http://www.gossamer-threads.com/lists/lucene/java-user/129668

In WeightedSpanTermExtractor the default maxDocCharsToAnalyze value is 0. This inhibits us from getting the weighted span terms in any custom code(e.g attached CustomHighlighter.java) that uses WeightedSpanTermExtractor. Currently the setMaxDocCharsToAnalyze() method is protected, which prevents us from setting maxDocCharsToAnalyze to a value greater than 0. Changing the method to public would give us the ability to set the maxDocCharsToAnalyze.

---
Migrated from [LUCENE-3287](https://issues.apache.org/jira/browse/LUCENE-3287) by Jahangir Anwari, updated Jul 11 2011
Attachments: [CustomHighlighter.java](https://apache.github.io/lucene-jira-archive/attachments/LUCENE-3287/CustomHighlighter.java), [WeightedSpanTermExtractor.patch](https://apache.github.io/lucene-jira-archive/attachments/LUCENE-3287/WeightedSpanTermExtractor.patch)

Contributor guide

Open the contributing guide

Research direction

Review WeightedSpanTermExtractor alongside the attached CustomHighlighter.java and WeightedSpanTermExtractor.patch. Start by locating setMaxDocCharsToAnalyze() and confirm how the default value of 0 affects custom callers. Done means callers can set maxDocCharsToAnalyze to a value greater than 0 through the public API.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
search
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.