On 16/01/14 08:41, Pierre-Andre Michel wrote:
Hello Andy,

As promised I have run a test to see if text:query allows the use of multiple 
predicates as proposed below:

thanks for testing that.  That way you can OR as well as AND.


So if you write:

?a text:query(pred:cv-name 'ubl AND field2:ubiquitin' 10) .

where field2 is the name of text:field name then you may be a single, 
conjunctive query.

OK,  I will try what you suggest and tell you if it works or not.

and the answer is: Yes, it works, great !

So I can run efficiently queries with multiple criteria (fields / predicates) 
for a single subject variable.
Now If I want to text:query 2 subject variables ?a and ?b, for example:

?a text:query(pred:organ 'liver', 25) .
?b text:query(pred:author 'John Smith') .

the second query will still be called 25 times if 25 solutions are found for ?a 
during graph traveral.
Why don't we cache the result of the queries so that after the first call we 
dont invoke solr or lucene anymore but simply return an iterator on the result 
list previously built ?
Does it make sense to you ?

The optimizer does nothing here so that's what happens. It needs a cross-product spotter to do that; it doesn't have one. The optimizer/evaluator has no concept of "text:query" being special so it blindly executes it.

But aren't you going to connect ?a and ?b in some way?

        Andy


Reply via email to