Tokenizer violates TokenStream.reset() contract?

2019-01-17 Thread Dan M
Hello,

It seems that Tokenizer may violate the contract put forth by the
TokenStream.reset function. Specifically, TokenStream.reset states:

"*Resets this stream to a clean state. Stateful implementations must
implement this method so that they can be reused, just as if they had been
created fresh.*"

Tokenizer does not do this. Tokenizers can only be reset one time. On
subsequent resets IllegalStateReader is swapped in as the Reader, and
incrementToken throws an exception.

The complication arises because Tokenizer takes a Reader and LUCENE-2387
was filed to intentionally unset the input (Reader) to prevent memory leak.
However, unsetting it means we can never read from the Tokenizer a 2nd time
(unless you set the Reader again) and thus it violates the contract.

Should there be a way to reuse Tokenizers?

Thanks,
Dan


Re: Iterative graph/nodes query

2019-01-22 Thread Dan M
Perhaps you're looking for the traversalFilter parameter of the graph query?

https://lucene.apache.org/solr/guide/7_6/other-parsers.html#graph-query-parser

Dan Meehl
Meehl Technology Solutions Inc


On Tue, Jan 22, 2019 at 7:13 AM Magnus Karlsson  wrote:

> Hi,
>
>
> anyone using any of the functionality of graphs either in a single
> collection (shortest path) or streaming expressions (nodes)?
>
>
> Experiences?
>
>
> / Magnus
>
> 
> Från: Magnus Karlsson 
> Skickat: den 17 december 2018 14:51:17
> Till: solr-user@lucene.apache.org
> Ämne: Iterative graph/nodes query
>
> Hi,
>
>
> looking at the graph traversal capabilities of solr. Is there a
> function/feature that traverses until certain pre-requisites are met?
>
>
> For instance, in an hierarchical use case, "traverse all children until a
> child has a certain name or type"?
>
>
> Using the current nodes streaming expression I need to know beforehand the
> number of levels I need to traverse.
>
>
> Is there a feature supporting this use-case or is it planned to be
> implemented?
>
>
> Thanks in advance.
>
>
> / Magnus
>
>