[
https://issues.apache.org/jira/browse/LUCENE-10220?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17438648#comment-17438648
]
Alan Woodward commented on LUCENE-10220:
----------------------------------------
Oh nice, I've been meaning to do something like this for ages and never got
round to it.
As far as attribution, perhaps the simplest thing to do is to keep the actual
implementation in a package-private `IntervalBuilder` file, and put a comment
at the top of the file pointing to the original source? And then keep the two
public static methods on `Intervals` and just delegate directly into
`IntervalBuilder`.
In the ES sources there's also an ASL-licensed `IntervalBuilderTests` file
which I think we could usefully reproduce? It will need to extend
LuceneTestCase rather than ESTestCase but I don't think there are any
elasticsearch-specific methods that it is using.
Adding to main and branch_9x makes sense to me, that targets lucene 9.1
> Add an utility method to get IntervalSource from analyzed text (or token
> stream)
> --------------------------------------------------------------------------------
>
> Key: LUCENE-10220
> URL: https://issues.apache.org/jira/browse/LUCENE-10220
> Project: Lucene - Core
> Issue Type: Improvement
> Reporter: Dawid Weiss
> Assignee: Dawid Weiss
> Priority: Minor
> Fix For: main (10.0)
>
>
> The Intervals has a number of utility methods that provide an IntervalSource
> for tokens, phrases, etc. But it's missing an important bit: an interval
> source matching tokens that are a result of some string applied to a full
> analysis chain. This corresponds to actually resides in the index and is hard
> to predict from the outside.
> This is an important omission in Intervals as a utility class.
> I borrowed the implementation from the then-ASL-licensed Elasticsearch code
> at:
> [https://github.com/elastic/elasticsearch/blob/7.10/server/src/main/java/org/elasticsearch/index/query/IntervalBuilder.java#L54-L106]
> I also modified it slightly to fit the static-method-based Lucene API. I also
> added a small test that showcases how this method can be used in practice
> (and why it's hard to accomplish the same result with existing methods).
> The only thing I'm not sure is how to attribute Elasticsearch properly - in
> the notice file, perhaps?
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]