Re: Query with spatial *and* text searches.

2015-12-28 Thread Andy Seaborne
On 27/12/15 20:28, Mark Wharton wrote: Hi Andy Thanks for your help. I've integrated those changes into the main search query and it's about 10x faster. Just one last question... What does the OFFSET 0 bit do in the query - force it to use the spatial/text index in preference to any other?

Re: Query with spatial *and* text searches.

2015-12-27 Thread Mark Wharton
Hi Andy Thanks for your help. I've integrated those changes into the main search query and it's about 10x faster. Just one last question... What does the OFFSET 0 bit do in the query - force it to use the spatial/text index in preference to any other? Mark Technology Lead, Iotic Labs +44

Re: Query with spatial *and* text searches.

2015-12-23 Thread Andy Seaborne
Hi Mark, Tricky. There isn't a good way to turn off or modify optimization for parts of a query without affecting the whole query. Jena 3.0.1 had a combination of changes - hash join but also stronger flattening queries into the form you don't want for the first part. The best I have come

Re: Query with spatial *and* text searches.

2015-12-23 Thread Mark Wharton
Hi Andy. That's cracked it. I was wondering about the sub-select route, but wasn't sure how to code the intersection part. I just tweaked it to return the score from the text query Your formulation 200 OK (231 ms) That's 200 OK by me... Enjoy the holidays Mark Technology Lead, Iotic Labs

Re: Query with spatial *and* text searches.

2015-12-23 Thread Mark Wharton
Hi Andy. More experiments this morning. I originally only send you a small part of a larger query just to expose the problem in its simplest form. And your switches work well in that case (i.e. first formulation below *with* the comments.) But... There's a problem when using the switches in

Re: Query with spatial *and* text searches.

2015-12-22 Thread Andy Seaborne
On 22/12/15 07:06, Mark Wharton wrote: Ah, wheels within wheels. The formulation with the filter in it is fine, except that if you want to search for more than one word or you match in label and comment then the UNION formulation returns you duplicate rows. This isn't a problem with the Lucene

Re: Query with spatial *and* text searches.

2015-12-22 Thread Andy Seaborne
Mark - here is another way. This query: SELECT ?score ?ent WHERE { { ?ent spatial:nearby ( ) } { ?ent text:query ( . ) } # No ?ent rdf:type iotic:Entity . # This focuses the query on the presenting issue. } and then run Fuseki with the following flags: --set

Re: Query with spatial *and* text searches.

2015-12-22 Thread Mark Wharton
Query below run without Andy's switches. INFO [5] 200 OK (4.985 s) Query below run with Andy's switches. INFO [1] 200 OK (840 ms) Them's some magic switches. Thanks, Andy. Do they have any impact (negative or positive) on any other SPARQL operations? I'm only curious as you've solved our

Re: Query with spatial *and* text searches.

2015-12-22 Thread Andy Seaborne
Mark, Thanks for the experiment results. On 22/12/15 15:47, Mark Wharton wrote: Query below run without Andy's switches. INFO [5] 200 OK (4.985 s) Query below run with Andy's switches. INFO [1] 200 OK (840 ms) Them's some magic switches. Thanks, Andy. Do they have any impact

Re: Query with spatial *and* text searches.

2015-12-21 Thread Osma Suominen
Hi Mark! Thanks for trying my queries. I'm sorry (but not surprised!) to hear that they weren't any better than your original query. I think JENA-999 is really the key here - until it is implemented, I don't know any way of speeding this up. My (very fuzzy) understanding of ARQ is that it

Re: Query with spatial *and* text searches.

2015-12-21 Thread Mark Wharton
Hi Osma. Thanks for your help. It was exactly the kind of help that I wanted. Haha, but life is rarely that simple... I ran all your versions and my original a couple of times each to see if there was any difference in performance. query time1 time2 Orig4.615 4.632 1 4.648

Re: Query with spatial *and* text searches.

2015-12-20 Thread Mark Wharton
Hi Marco. Yes, that's it. The indexes work well in isolation, but don't combine well. Smooshing them into a single index would be a great idea, especially if the query could resolve both text and spatial predicates with one matching scan of the index. Perhaps Stephen could be persuaded to

Re: Query with spatial *and* text searches.

2015-12-20 Thread Osma Suominen
Hi Mark! I'm not sure that the jena-external-index approach would help. It might or might not, depending on how it's implemented. AFAIK it's just an idea right now, I haven't seen any code. In any case I think the problem with jena-text and probably jena-spatial too (not very familiar with

Re: Query with spatial *and* text searches.

2015-12-19 Thread Mark Wharton
Hi Thanks for this. I've read the chapter in the book and now I'm not sure if I misunderstand your reply or you've only addressed half of the problem. I'm not worried about the performance of the spatial search in isolation - that's 97ms which is fine. The text search on its own takes a bit

Query with spatial *and* text searches.

2015-12-18 Thread Mark Wharton
Hi Jena users. I'm having performance problems with a query that uses text and location search The query is roughly this: SELECT ?score ?ent WHERE { ?ent spatial:nearby(51.507999420166016 -0.1099940395355 70.01807880401611 'km') . (?ent ?score) text:query