[infinispan-dev] new Infinispan Query API - ISPN-194

Sanne Grinovero sanne.grinovero at gmail.com
Mon Apr 11 09:37:35 EDT 2011


Hi,
answering inline:

2011/4/11 Israel Lacerra <israeldl at gmail.com>:
> Hi Sanne,
>
> When I create a LazyIterator, every node makes a local normal query and
> thern I return the TopDocs to the requester node. With TopDocs I can merge
> the results and maintain them ordered. I'm using the idea behind
> org.apache.lucene.search.ParallelMultiSearcher.search(Weight, Filter, int,
> Sort).

sure, I remember the idea.

>
>
>> We could make the classes
>> org.hibernate.search.query.engine.impl.HSQueryImpl
>> org.hibernate.search.query.engine.impl.QueryHits
>> suitable for being extended (changing most private methods to
>> protected, and also refactor the HSQueryImpl to possibly use a
>> different type for QueryHits)
>
> As I see now, I don't need changes in QueryHits. The current implementation
> has a getTopDocs() that solves my problem. On HSQueryImpl, I need the
> QueryHits that could be created by HSQueryImpl.getQueryHits(
> buildSearcher(), calculateTopDocsRetrievalSize()). So, changing these three
> methods to protected or creating a getQueryHits() that hides them, would
> solve my problem.

Yes it's not hard, I was looking into making those methods protected,
we can also easily destructure some methods in smaller ones so that
you can override specific factories, like the QueryHits in case you
need.
Then instead of making a HSQueryImpl you use your own extension. It
would still be nice to hide your magic behind the HSQuery interface.
>
>> and then making sure that it's possible to have
>> org.hibernate.search.spi.SearchFactoryIntegrator.createHSQuery()
>> return a custom type.
>
> This could be a little hard, no? I don't wanna create problems to you!
It's not a problem, actually as mentioned above you can avoid invoking
the method. so it's very simple :)

>
> If you can't make these changes, I can find another way. I just want to
> create a query and get the TopDocs. This could be done in another way,
> probably writing more code....
I hope we find a way to write less code actually ;)
exposing TopDocs on the HSQuery doesn't seem right, let me know if the
extension points would work. you can change the code directly and play
with it to see how it works; when it does, send us a pull request so
we can discuss this to be merged on Search very soon.

>
> And yes, I have the source code!
>
> Let me know what you think.
>
> Thanks!
>
> Israel
>


More information about the infinispan-dev mailing list