On 18/01/2021 15:41, Deepali Singhavi wrote:
Hi,

Below is the response I am getting after running curl command for my index.

{"jena-text":{"aliases":{},"mappings":{"properties":{"description":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"label":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"name":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}}}},"settings":{"index":{"routing":{"allocation":{"include":{"_tier_preference":"data_content"}}},"number_of_shards":"1","provided_name":"jena-text","creation_date":"1610455372155","number_of_replicas":"1","uuid":"XUmCT-TtTa-Ip-gCkbiQHg","version":{"created":"7100199"}}}}}


That does not look like the result of a search.

https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html

Also - I found this:

https://stackoverflow.com/questions/22093334/how-to-make-query-string-search-exact-phrase-in-elasticsearch

about analysers (server setup issue)

also:
https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html

For help with setup of the ES cluster, you may find it helpful to ask within your organisation.

        Andy

Regards,
Deepali

On Mon, Jan 18, 2021 at 7:54 PM Andy Seaborne <a...@apache.org> wrote:



On 18/01/2021 04:38, Deepali Singhavi wrote:
Hi Andy,

Have you got it working use a text based query, that is, using the
"query_string" member in JSON,direct to the ES API?
--- No it is still not working.
I am configuring ElasticSearch in Jena using a config ttl file. For using
ES API can I do it from Jena UI using SPARQL or do I need to write any
code
for it?

The point is to use ES directly without going through Jena to see if the
capability you want works in the way you expect and that ES is setup and
loaded with data.

You can use "curl" to do this. It is a matter of sending a JSON
document. "query_string" is part of that.

How to use the "query_string" member in JSON is it possible to append
this
in SPARQL?

I believe that the ES Java client code will format the JSON object. The
first step is to ensure the feature available as expected and data all
set up at he ES installation.

      Andy


Regards,
Deepali

On Fri, Jan 15, 2021 at 11:29 PM Andy Seaborne <a...@apache.org> wrote:


On 15/01/2021 12:03, Deepali Singhavi wrote:
Hi Andy,

This code is in Java and we are working on Dot Net and using Sparql to
work
with Jena using DotNetRDF library.

I can see DotNetRDF is having  support for Lucene but not for
ElasticSearch.

DotNetRDF is a separate project.

I have tried with multiple documents but not getting how we can modify
SPARQL query to use ES advanced features like match phrases.

Can you please help me with an example of how a match phrase can be
implemented with a SPARQL query without java code? is it possible?

Have you got it working use a text based query, that is, using the
"query_string" member in JSON,direct to the ES API?

       Andy


Regards,
Deepali



On Wed, Jan 13, 2021 at 3:17 PM Lorenz Buehmann <
buehm...@informatik.uni-leipzig.de> wrote:

that's not gonna work ...

text:query:match_phrase

is an invalid SPARQL predicate. You can try to put the "match_phrase"
into the query string, but I don't think it will work. A "query string
query" is used via the ES Java API [1]

Syntax can be found online [2]

[1]



https://github.com/apache/jena/blob/master/jena-text-es/src/main/java/org/apache/jena/query/text/es/TextIndexES.java#L409
[2]



https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html


On 13.01.21 06:58, Deepali Singhavi wrote:
Hi Andy,

I have gone through the elastic search documentation and I know there
is
an
option of *match_phrase *but I want to know how it will work with
SPARQL
query.

For example I have tried the below query but it is not working so I
want
to
understand the syntax.

prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix star:   <http://stardog.com/tutorial/>
PREFIX text: <http://jena.apache.org/text#>
select ?subject ?object
from <urn:music>
WHERE {
?subject *text:query:match_phrase* (star:description "\"rock band
Queen\"")
.
?subject star:description  ?object .
}

Regards,
Deepali

On Tue, Jan 12, 2021 at 7:52 PM Andy Seaborne <a...@apache.org>
wrote:

Check the documentation for Lucene and ElasticSearch. jena-text
passes
the text query straight through.

On 12/01/2021 13:32, Deepali Singhavi wrote:
Hi,

I am trying to match exact phrases using SPARQL but for Lucene it
is
working but not for Elastic search. Do I need to make any changes
to
make it work for ES.I have attached my sample ttl file and below is
the
query

Query:
prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#
<http://www.w3.org/1999/02/22-rdf-syntax-ns#>>
prefix star:   <http://stardog.com/tutorial/
<http://stardog.com/tutorial/>>
PREFIX text: <http://jena.apache.org/text# <
http://jena.apache.org/text#
select ?subject ?object
from <urn:music>
WHERE {
?subject text:query (star:description "\"rock band Queen\"") .
?subject star:description  ?object .
}

Please let me know if any other information is required from my
side.

Regards,
Deepali







Reply via email to