Re: More Spatial Relations

2018-06-01 Thread David Smiley
For predicates other than "intersects", that is true :-/  Any help you
might be interested in offering here is most welcome.

On Fri, Jun 1, 2018 at 8:38 PM Bingtao Yin  wrote:

> Hi David,
>
> Thanks for you reply.
>
> Compared to the prefix tree, implementation through doc-value seems slow.
> It needs to load shapes from doc-value for all docs and check each with the
> query shape.
>
>
> 2018-06-02 3:31 GMT+08:00 David Smiley :
>
> > Hi Bingtao,
> >
> > > If I want to implement query for other relations, should I just
> serialize
> > shape to binary format(e.g. wkb) and fall back to jts?
> >
> > Yes.  There's a lot already there but you'd need to subclass some stuff
> to
> > add some other predicates.  See CompositeSpatialStrategy and
> > ShapeValuesPredicate.  You could cast the value, a Shape, to a
> JtsGeometry
> > (a Spatial4j shape) and then call getGeom() to get the underlying JTS
> > Geometry instance.  If you find you need to fork entire classes then feel
> > free to suggest improvements to the extensibility.
> >
> > ~ David
> >
> > On Tue, May 29, 2018 at 10:52 PM Bingtao Yin  wrote:
> >
> > > Hi guys,
> > >
> > > Currently only limited spatial relations are supported(e.g.
> > > withins/intersects in prefix tree). In DE-9IM, there are abount 8
> > > relations.
> > >
> > > If I want to implement query for other relations, should I just
> serialize
> > > shape to binary format(e.g. wkb) and fall back to jts?
> > >
> > > Any development plan on other relations? or will BKD tree support ogc
> > > geometries and DE-9IM relations?
> > >
> > --
> > Lucene/Solr Search Committer, Consultant, Developer, Author, Speaker
> > LinkedIn: http://linkedin.com/in/davidwsmiley | Book:
> > http://www.solrenterprisesearchserver.com
> >
>
-- 
Lucene/Solr Search Committer, Consultant, Developer, Author, Speaker
LinkedIn: http://linkedin.com/in/davidwsmiley | Book:
http://www.solrenterprisesearchserver.com


Re: More Spatial Relations

2018-06-01 Thread Bingtao Yin
Hi David,

Thanks for you reply.

Compared to the prefix tree, implementation through doc-value seems slow.
It needs to load shapes from doc-value for all docs and check each with the
query shape.


2018-06-02 3:31 GMT+08:00 David Smiley :

> Hi Bingtao,
>
> > If I want to implement query for other relations, should I just serialize
> shape to binary format(e.g. wkb) and fall back to jts?
>
> Yes.  There's a lot already there but you'd need to subclass some stuff to
> add some other predicates.  See CompositeSpatialStrategy and
> ShapeValuesPredicate.  You could cast the value, a Shape, to a JtsGeometry
> (a Spatial4j shape) and then call getGeom() to get the underlying JTS
> Geometry instance.  If you find you need to fork entire classes then feel
> free to suggest improvements to the extensibility.
>
> ~ David
>
> On Tue, May 29, 2018 at 10:52 PM Bingtao Yin  wrote:
>
> > Hi guys,
> >
> > Currently only limited spatial relations are supported(e.g.
> > withins/intersects in prefix tree). In DE-9IM, there are abount 8
> > relations.
> >
> > If I want to implement query for other relations, should I just serialize
> > shape to binary format(e.g. wkb) and fall back to jts?
> >
> > Any development plan on other relations? or will BKD tree support ogc
> > geometries and DE-9IM relations?
> >
> --
> Lucene/Solr Search Committer, Consultant, Developer, Author, Speaker
> LinkedIn: http://linkedin.com/in/davidwsmiley | Book:
> http://www.solrenterprisesearchserver.com
>


Re: More Spatial Relations

2018-06-01 Thread David Smiley
Hi Bingtao,

> If I want to implement query for other relations, should I just serialize
shape to binary format(e.g. wkb) and fall back to jts?

Yes.  There's a lot already there but you'd need to subclass some stuff to
add some other predicates.  See CompositeSpatialStrategy and
ShapeValuesPredicate.  You could cast the value, a Shape, to a JtsGeometry
(a Spatial4j shape) and then call getGeom() to get the underlying JTS
Geometry instance.  If you find you need to fork entire classes then feel
free to suggest improvements to the extensibility.

~ David

On Tue, May 29, 2018 at 10:52 PM Bingtao Yin  wrote:

> Hi guys,
>
> Currently only limited spatial relations are supported(e.g.
> withins/intersects in prefix tree). In DE-9IM, there are abount 8
> relations.
>
> If I want to implement query for other relations, should I just serialize
> shape to binary format(e.g. wkb) and fall back to jts?
>
> Any development plan on other relations? or will BKD tree support ogc
> geometries and DE-9IM relations?
>
-- 
Lucene/Solr Search Committer, Consultant, Developer, Author, Speaker
LinkedIn: http://linkedin.com/in/davidwsmiley | Book:
http://www.solrenterprisesearchserver.com


EarlyTerminatingSortingCollector is expired in lucene 7.2.1

2018-06-01 Thread Yonghui Zhao
Hi,

I find EarlyTerminatingSortingCollector is expired in lucene 7.2.1.

Java doc says Pass trackTotalHits=false to {@link TopFieldCollector}
instead of using this class.

But I find TopFiledCollector can not fully replace
EarlyTerminatingSortingCollector.

In EarlyTerminatingSortingCollector there is a numDocsToCollect parameter
while TopFiledCollector has not.

Usually we want to early terminate collecting in a reasonable big number.

Let's say I want top 10 result from top 1,000,000 sorting doc while real
total hit may be a huge number.

In TopFiledCollector, if I pass numHits as 1,000,000 then the priority
queue size should be 1,000,000 which is a waste of memory.

In EarlyTerminatingSortingCollector we can set numDocsToCollect as 1,000,000,
but the priority queue size of filter collector may be only 10.

Is it right?