[jira] [Commented] (OAK-6201) Native Query syntax for rep:native unclear

2020-07-15 Thread Konrad Windszus (Jira)


[ 
https://issues.apache.org/jira/browse/OAK-6201?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17158606#comment-17158606
 ] 

Konrad Windszus commented on OAK-6201:
--

After some reverse engineering I figured out the following:

# The syntax for native queries is described at 
https://lucene.apache.org/core/4_7_1/queryparser/org/apache/lucene/queryparser/classic/package-summary.html
# The query parser for native functions does not set a default field name 
(https://github.com/apache/jackrabbit-oak/blob/80b32f5577522d689cdc3649f64e23d9a4b5a862/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LucenePropertyIndex.java#L874)
# The field name for the fulltext index is {{:fulltext}} 
(https://github.com/apache/jackrabbit-oak/blob/64699521cd23664775d83d39146d1fe659d3495b/oak-search/src/main/java/org/apache/jackrabbit/oak/plugins/index/search/FieldNames.java#L55)
# You have to escape the colon in the field name, so that a valid query might 
look like this in SQL2 {{... native('custom-index-function-name', 
'\:fulltext:()')}}

> Native Query syntax for rep:native unclear
> --
>
> Key: OAK-6201
> URL: https://issues.apache.org/jira/browse/OAK-6201
> Project: Jackrabbit Oak
>  Issue Type: Documentation
>Reporter: David Gonzalez
>Assignee: Tommaso Teofili
>Priority: Minor
>
> I was trying to perform a few test queries against an Oak 1.6.x repository 
> using the XPath with the rep:native(..) function and but could not get any to 
> work.
> I suspect my problem is with specifying the field, but i've tried a variety 
> of permutations to no avail. 
> For example, if tried to re-purpose the example XPath query to search over an 
> asset's dc:title [1],
> Generally, i think the documentation [2] is lacking in that 1) unclear on the 
> syntax 2) unclear if i need to do anything special to Oak indexes 3) if only 
> the provided lucene index will service these requests (these are all from a 
> lucene POV, rather than Solr, though assume all the same considerations apply)
> [1] Non-working: {code}
> //element(*, app:Asset)[(rep:native('lucene', 
> 'jcr:contnet/metdata/dc:title:(Hello OR World)'))]
> {code}
> [2] 
> http://jackrabbit.apache.org/oak/docs/query/query-engine.html#Native_Queries



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (OAK-6201) Native Query syntax for rep:native unclear

2020-07-14 Thread Konrad Windszus (Jira)


[ 
https://issues.apache.org/jira/browse/OAK-6201?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17157472#comment-17157472
 ] 

Konrad Windszus commented on OAK-6201:
--

A page for how JCR properties are translated to field names in Lucene and Solr 
would be highly appreciated. [~teofili] Would you be able to come up with 
something in the near future?

> Native Query syntax for rep:native unclear
> --
>
> Key: OAK-6201
> URL: https://issues.apache.org/jira/browse/OAK-6201
> Project: Jackrabbit Oak
>  Issue Type: Documentation
>Reporter: David Gonzalez
>Assignee: Tommaso Teofili
>Priority: Minor
>
> I was trying to perform a few test queries against an Oak 1.6.x repository 
> using the XPath with the rep:native(..) function and but could not get any to 
> work.
> I suspect my problem is with specifying the field, but i've tried a variety 
> of permutations to no avail. 
> For example, if tried to re-purpose the example XPath query to search over an 
> asset's dc:title [1],
> Generally, i think the documentation [2] is lacking in that 1) unclear on the 
> syntax 2) unclear if i need to do anything special to Oak indexes 3) if only 
> the provided lucene index will service these requests (these are all from a 
> lucene POV, rather than Solr, though assume all the same considerations apply)
> [1] Non-working: {code}
> //element(*, app:Asset)[(rep:native('lucene', 
> 'jcr:contnet/metdata/dc:title:(Hello OR World)'))]
> {code}
> [2] 
> http://jackrabbit.apache.org/oak/docs/query/query-engine.html#Native_Queries



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (OAK-6201) Native Query syntax for rep:native unclear

2017-05-11 Thread Tommaso Teofili (JIRA)

[ 
https://issues.apache.org/jira/browse/OAK-6201?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16006421#comment-16006421
 ] 

Tommaso Teofili commented on OAK-6201:
--

>  Looking forward to the eventual doc updates!

+1
note that the mentioned page at [1[ is the generic page for nativa language 
support, we should have a dedicated section in our Lucene and Solr indexes that 
describes each indexing implementation assumptions and expectations with 
regards to that, with examples.

> Native Query syntax for rep:native unclear
> --
>
> Key: OAK-6201
> URL: https://issues.apache.org/jira/browse/OAK-6201
> Project: Jackrabbit Oak
>  Issue Type: Documentation
>Reporter: David Gonzalez
>Priority: Minor
>
> I was trying to perform a few test queries against an Oak 1.6.x repository 
> using the XPath with the rep:native(..) function and but could not get any to 
> work.
> I suspect my problem is with specifying the field, but i've tried a variety 
> of permutations to no avail. 
> For example, if tried to re-purpose the example XPath query to search over an 
> asset's dc:title [1],
> Generally, i think the documentation [2] is lacking in that 1) unclear on the 
> syntax 2) unclear if i need to do anything special to Oak indexes 3) if only 
> the provided lucene index will service these requests (these are all from a 
> lucene POV, rather than Solr, though assume all the same considerations apply)
> [1] Non-working: {code}
> //element(*, app:Asset)[(rep:native('lucene', 
> 'jcr:contnet/metdata/dc:title:(Hello OR World)'))]
> {code}
> [2] 
> http://jackrabbit.apache.org/oak/docs/query/query-engine.html#Native_Queries



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (OAK-6201) Native Query syntax for rep:native unclear

2017-05-11 Thread David Gonzalez (JIRA)

[ 
https://issues.apache.org/jira/browse/OAK-6201?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16006357#comment-16006357
 ] 

David Gonzalez commented on OAK-6201:
-

[~teofili] Agree; IME not many developers that work on oak-platforms have an 
understanding of lucene's underpinnings, making the many nods to lucene 
functionalities confounding; TBH, im still unclear how to derive the field name 
for any bit of data indexed into the lucene document. (which is fine, as this 
should be addressed in the docs, not necessarily in the jira issue). Looking 
forward to the eventual doc updates! 

> Native Query syntax for rep:native unclear
> --
>
> Key: OAK-6201
> URL: https://issues.apache.org/jira/browse/OAK-6201
> Project: Jackrabbit Oak
>  Issue Type: Documentation
>Reporter: David Gonzalez
>Priority: Minor
>
> I was trying to perform a few test queries against an Oak 1.6.x repository 
> using the XPath with the rep:native(..) function and but could not get any to 
> work.
> I suspect my problem is with specifying the field, but i've tried a variety 
> of permutations to no avail. 
> For example, if tried to re-purpose the example XPath query to search over an 
> asset's dc:title [1],
> Generally, i think the documentation [2] is lacking in that 1) unclear on the 
> syntax 2) unclear if i need to do anything special to Oak indexes 3) if only 
> the provided lucene index will service these requests (these are all from a 
> lucene POV, rather than Solr, though assume all the same considerations apply)
> [1] Non-working: {code}
> //element(*, app:Asset)[(rep:native('lucene', 
> 'jcr:contnet/metdata/dc:title:(Hello OR World)'))]
> {code}
> [2] 
> http://jackrabbit.apache.org/oak/docs/query/query-engine.html#Native_Queries



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (OAK-6201) Native Query syntax for rep:native unclear

2017-05-10 Thread Tommaso Teofili (JIRA)

[ 
https://issues.apache.org/jira/browse/OAK-6201?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16004727#comment-16004727
 ] 

Tommaso Teofili commented on OAK-6201:
--

I think your problem relates to the assumption that a (relative) property maps 
1:1 with a Lucene index, which is not the case, e.g. properties that are used 
for full text search will usually have a name like _:fulltext:dc:title_.
On the other hand we need to consider the fact that not all of the users may 
have knowledge about how information about a certain property is indexed into 
Lucene (or Solr) therefore it'd be helpful to provide some guidance on how to 
use native query language depending on configuration of the Oak Lucene index to 
be used.

> Native Query syntax for rep:native unclear
> --
>
> Key: OAK-6201
> URL: https://issues.apache.org/jira/browse/OAK-6201
> Project: Jackrabbit Oak
>  Issue Type: Documentation
>Reporter: David Gonzalez
>Priority: Minor
>
> I was trying to perform a few test queries against an Oak 1.6.x repository 
> using the XPath with the rep:native(..) function and but could not get any to 
> work.
> I suspect my problem is with specifying the field, but i've tried a variety 
> of permutations to no avail. 
> For example, if tried to re-purpose the example XPath query to search over an 
> asset's dc:title [1],
> Generally, i think the documentation [2] is lacking in that 1) unclear on the 
> syntax 2) unclear if i need to do anything special to Oak indexes 3) if only 
> the provided lucene index will service these requests (these are all from a 
> lucene POV, rather than Solr, though assume all the same considerations apply)
> [1] Non-working: {code}
> //element(*, app:Asset)[(rep:native('lucene', 
> 'jcr:contnet/metdata/dc:title:(Hello OR World)'))]
> {code}
> [2] 
> http://jackrabbit.apache.org/oak/docs/query/query-engine.html#Native_Queries



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)