Depending on the type of field, you can normally do:
Field myField = …
index.addField(fieldName, myField.tokenStream(null, null))
I agree that this could be a bit nicer, though. MemoryIndex doesn't support
DocValues yet either, although I think there is an open ticket to add that.
Alan Woodward
www.flax.co.uk
On 20 Jan 2016, at 18:32, xavi jmlucjav wrote:
> Hi,
>
> I am on lucene 5.3.1
>
> I am running a doc at a time through a bunch of Queries. This is working
> nicely with the MemoryIndex and combinations of
> TermQuery/NumericRangeQuery. Now I wanted to add spatial stuff, so I
> happily added more queries with SpatialStrategy.makeQuery(...).
>
> But, when I go to add the corresponding field to the MemoryIndex...I am not
> sure how to do this, the only way to add fields to a MemoryIndex seems:
>
> MemoryIndex index = new MemoryIndex();
> index.addField("content", "Readings about Salmons and other select
> Alaska fishing Manuals", analyzer);
> index.addField("author", "Tales of James", analyzer);
>
> Is this combination possible?? I expected (naively?) it would work out of
> the box.
>
> thanks
> xavi