[jira] [Commented] (OAK-3156) Lucene suggestions index definition can't be restricted to a specific type of node

2016-04-06 Thread Vikas Saurabh (JIRA)

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

Vikas Saurabh commented on OAK-3156:


Backported to 1.2 in [r1738063|https://svn.apache.org/r1738063].

> Lucene suggestions index definition can't be restricted to a specific type of 
> node
> --
>
> Key: OAK-3156
> URL: https://issues.apache.org/jira/browse/OAK-3156
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: lucene
>Reporter: Vikas Saurabh
>Assignee: Tommaso Teofili
>Priority: Blocker
> Fix For: 1.4, 1.3.9, 1.2.14
>
> Attachments: LuceneIndexSuggestionTest.java, OAK-3156-take2.patch, 
> OAK-3156.patch
>
>
> While performing a suggestor query like 
> {code}
> SELECT [rep:suggest()] as suggestion  FROM [nt:unstructured] WHERE 
> suggest('foo')
> {code}
> Suggestor does not provide any result. In current implementation, 
> [suggestions|http://jackrabbit.apache.org/oak/docs/query/lucene.html#Suggestions]
>  in Oak work only for index definitions for {{nt:base}} nodetype.
> So, an index definition like:
> {code:xml}
>  jcr:primaryType="oak:QueryIndexDefinition"
> async="async"
> compatVersion="{Long}2"
> type="lucene">
> 
> 
> 
>  jcr:primaryType="nt:unstructured"
> analyzed="{Boolean}true"
> name="description"
> propertyIndex="{Boolean}true"
> useInSuggest="{Boolean}true"/>
> 
> 
> 
> 
> {code}
> works, but if we change nodetype to {{nt:unstructured}} like:
> {code:xml}
>  jcr:primaryType="oak:QueryIndexDefinition"
> async="async"
> compatVersion="{Long}2"
> type="lucene">
> 
> 
> 
>  jcr:primaryType="nt:unstructured"
> analyzed="{Boolean}true"
> name="description"
> propertyIndex="{Boolean}true"
> useInSuggest="{Boolean}true"/>
> 
> 
> 
> 
> {code}
> , it won't work.
> The issue is that suggestor implementation essentially is passing a pseudo 
> row with path=/.:
> {code:title=LucenePropertyIndex.java}
> private boolean loadDocs() {
> ...
> queue.add(new LuceneResultRow(suggestedWords));
> ...
> {code}
> and
> {code:title=LucenePropertyIndex.java}
> LuceneResultRow(Iterable suggestWords) {
> this.path = "/";
> this.score = 1.0d;
> this.suggestWords = suggestWords;
> }
> {code}
> Due to path being set to "/", {{SelectorImpl}} later filters out the result 
> as {{rep:root}} (primary type of "/") isn't a {{nt:unstructured}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OAK-3156) Lucene suggestions index definition can't be restricted to a specific type of node

2015-10-12 Thread Tommaso Teofili (JIRA)

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

Tommaso Teofili commented on OAK-3156:
--

the second patch (for option 1) looks good to me.

> Lucene suggestions index definition can't be restricted to a specific type of 
> node
> --
>
> Key: OAK-3156
> URL: https://issues.apache.org/jira/browse/OAK-3156
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: lucene
>Reporter: Vikas Saurabh
>Assignee: Tommaso Teofili
>Priority: Blocker
> Fix For: 1.3.9
>
> Attachments: LuceneIndexSuggestionTest.java, OAK-3156-take2.patch, 
> OAK-3156.patch
>
>
> While performing a suggestor query like 
> {code}
> SELECT [rep:suggest()] as suggestion  FROM [nt:unstructured] WHERE 
> suggest('foo')
> {code}
> Suggestor does not provide any result. In current implementation, 
> [suggestions|http://jackrabbit.apache.org/oak/docs/query/lucene.html#Suggestions]
>  in Oak work only for index definitions for {{nt:base}} nodetype.
> So, an index definition like:
> {code:xml}
>  jcr:primaryType="oak:QueryIndexDefinition"
> async="async"
> compatVersion="{Long}2"
> type="lucene">
> 
> 
> 
>  jcr:primaryType="nt:unstructured"
> analyzed="{Boolean}true"
> name="description"
> propertyIndex="{Boolean}true"
> useInSuggest="{Boolean}true"/>
> 
> 
> 
> 
> {code}
> works, but if we change nodetype to {{nt:unstructured}} like:
> {code:xml}
>  jcr:primaryType="oak:QueryIndexDefinition"
> async="async"
> compatVersion="{Long}2"
> type="lucene">
> 
> 
> 
>  jcr:primaryType="nt:unstructured"
> analyzed="{Boolean}true"
> name="description"
> propertyIndex="{Boolean}true"
> useInSuggest="{Boolean}true"/>
> 
> 
> 
> 
> {code}
> , it won't work.
> The issue is that suggestor implementation essentially is passing a pseudo 
> row with path=/.:
> {code:title=LucenePropertyIndex.java}
> private boolean loadDocs() {
> ...
> queue.add(new LuceneResultRow(suggestedWords));
> ...
> {code}
> and
> {code:title=LucenePropertyIndex.java}
> LuceneResultRow(Iterable suggestWords) {
> this.path = "/";
> this.score = 1.0d;
> this.suggestWords = suggestWords;
> }
> {code}
> Due to path being set to "/", {{SelectorImpl}} later filters out the result 
> as {{rep:root}} (primary type of "/") isn't a {{nt:unstructured}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OAK-3156) Lucene suggestions index definition can't be restricted to a specific type of node

2015-10-12 Thread Tommaso Teofili (JIRA)

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

Tommaso Teofili commented on OAK-3156:
--

+1 from my side

> Lucene suggestions index definition can't be restricted to a specific type of 
> node
> --
>
> Key: OAK-3156
> URL: https://issues.apache.org/jira/browse/OAK-3156
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: lucene
>Reporter: Vikas Saurabh
>Assignee: Tommaso Teofili
>Priority: Blocker
> Fix For: 1.3.9
>
> Attachments: LuceneIndexSuggestionTest.java, OAK-3156-take2.patch, 
> OAK-3156.patch
>
>
> While performing a suggestor query like 
> {code}
> SELECT [rep:suggest()] as suggestion  FROM [nt:unstructured] WHERE 
> suggest('foo')
> {code}
> Suggestor does not provide any result. In current implementation, 
> [suggestions|http://jackrabbit.apache.org/oak/docs/query/lucene.html#Suggestions]
>  in Oak work only for index definitions for {{nt:base}} nodetype.
> So, an index definition like:
> {code:xml}
>  jcr:primaryType="oak:QueryIndexDefinition"
> async="async"
> compatVersion="{Long}2"
> type="lucene">
> 
> 
> 
>  jcr:primaryType="nt:unstructured"
> analyzed="{Boolean}true"
> name="description"
> propertyIndex="{Boolean}true"
> useInSuggest="{Boolean}true"/>
> 
> 
> 
> 
> {code}
> works, but if we change nodetype to {{nt:unstructured}} like:
> {code:xml}
>  jcr:primaryType="oak:QueryIndexDefinition"
> async="async"
> compatVersion="{Long}2"
> type="lucene">
> 
> 
> 
>  jcr:primaryType="nt:unstructured"
> analyzed="{Boolean}true"
> name="description"
> propertyIndex="{Boolean}true"
> useInSuggest="{Boolean}true"/>
> 
> 
> 
> 
> {code}
> , it won't work.
> The issue is that suggestor implementation essentially is passing a pseudo 
> row with path=/.:
> {code:title=LucenePropertyIndex.java}
> private boolean loadDocs() {
> ...
> queue.add(new LuceneResultRow(suggestedWords));
> ...
> {code}
> and
> {code:title=LucenePropertyIndex.java}
> LuceneResultRow(Iterable suggestWords) {
> this.path = "/";
> this.score = 1.0d;
> this.suggestWords = suggestWords;
> }
> {code}
> Due to path being set to "/", {{SelectorImpl}} later filters out the result 
> as {{rep:root}} (primary type of "/") isn't a {{nt:unstructured}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OAK-3156) Lucene suggestions index definition can't be restricted to a specific type of node

2015-10-12 Thread Vikas Saurabh (JIRA)

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

Vikas Saurabh commented on OAK-3156:


Opened OAK-3507 to track 'virtual rows need to have path set as {{null}}'. 
[~tmueller], [~teofili], can we please use apply this 
[patch|^OAK-3156-take2.patch] (option 1 second patch) to resolve this issue?

> Lucene suggestions index definition can't be restricted to a specific type of 
> node
> --
>
> Key: OAK-3156
> URL: https://issues.apache.org/jira/browse/OAK-3156
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: lucene
>Reporter: Vikas Saurabh
>Assignee: Tommaso Teofili
>Priority: Blocker
> Fix For: 1.3.9
>
> Attachments: LuceneIndexSuggestionTest.java, OAK-3156-take2.patch, 
> OAK-3156.patch
>
>
> While performing a suggestor query like 
> {code}
> SELECT [rep:suggest()] as suggestion  FROM [nt:unstructured] WHERE 
> suggest('foo')
> {code}
> Suggestor does not provide any result. In current implementation, 
> [suggestions|http://jackrabbit.apache.org/oak/docs/query/lucene.html#Suggestions]
>  in Oak work only for index definitions for {{nt:base}} nodetype.
> So, an index definition like:
> {code:xml}
>  jcr:primaryType="oak:QueryIndexDefinition"
> async="async"
> compatVersion="{Long}2"
> type="lucene">
> 
> 
> 
>  jcr:primaryType="nt:unstructured"
> analyzed="{Boolean}true"
> name="description"
> propertyIndex="{Boolean}true"
> useInSuggest="{Boolean}true"/>
> 
> 
> 
> 
> {code}
> works, but if we change nodetype to {{nt:unstructured}} like:
> {code:xml}
>  jcr:primaryType="oak:QueryIndexDefinition"
> async="async"
> compatVersion="{Long}2"
> type="lucene">
> 
> 
> 
>  jcr:primaryType="nt:unstructured"
> analyzed="{Boolean}true"
> name="description"
> propertyIndex="{Boolean}true"
> useInSuggest="{Boolean}true"/>
> 
> 
> 
> 
> {code}
> , it won't work.
> The issue is that suggestor implementation essentially is passing a pseudo 
> row with path=/.:
> {code:title=LucenePropertyIndex.java}
> private boolean loadDocs() {
> ...
> queue.add(new LuceneResultRow(suggestedWords));
> ...
> {code}
> and
> {code:title=LucenePropertyIndex.java}
> LuceneResultRow(Iterable suggestWords) {
> this.path = "/";
> this.score = 1.0d;
> this.suggestWords = suggestWords;
> }
> {code}
> Due to path being set to "/", {{SelectorImpl}} later filters out the result 
> as {{rep:root}} (primary type of "/") isn't a {{nt:unstructured}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OAK-3156) Lucene suggestions index definition can't be restricted to a specific type of node

2015-10-12 Thread Tommaso Teofili (JIRA)

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

Tommaso Teofili commented on OAK-3156:
--

also I think a discussion around result a suggestion per row would fit better 
into a dedicated issue, as here I'm more concerned about the bug at hand 
regarding node type restriction not being taken into account properly.

> Lucene suggestions index definition can't be restricted to a specific type of 
> node
> --
>
> Key: OAK-3156
> URL: https://issues.apache.org/jira/browse/OAK-3156
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: lucene
>Reporter: Vikas Saurabh
>Assignee: Tommaso Teofili
>Priority: Blocker
> Fix For: 1.3.9
>
> Attachments: LuceneIndexSuggestionTest.java, OAK-3156-take2.patch, 
> OAK-3156.patch
>
>
> While performing a suggestor query like 
> {code}
> SELECT [rep:suggest()] as suggestion  FROM [nt:unstructured] WHERE 
> suggest('foo')
> {code}
> Suggestor does not provide any result. In current implementation, 
> [suggestions|http://jackrabbit.apache.org/oak/docs/query/lucene.html#Suggestions]
>  in Oak work only for index definitions for {{nt:base}} nodetype.
> So, an index definition like:
> {code:xml}
>  jcr:primaryType="oak:QueryIndexDefinition"
> async="async"
> compatVersion="{Long}2"
> type="lucene">
> 
> 
> 
>  jcr:primaryType="nt:unstructured"
> analyzed="{Boolean}true"
> name="description"
> propertyIndex="{Boolean}true"
> useInSuggest="{Boolean}true"/>
> 
> 
> 
> 
> {code}
> works, but if we change nodetype to {{nt:unstructured}} like:
> {code:xml}
>  jcr:primaryType="oak:QueryIndexDefinition"
> async="async"
> compatVersion="{Long}2"
> type="lucene">
> 
> 
> 
>  jcr:primaryType="nt:unstructured"
> analyzed="{Boolean}true"
> name="description"
> propertyIndex="{Boolean}true"
> useInSuggest="{Boolean}true"/>
> 
> 
> 
> 
> {code}
> , it won't work.
> The issue is that suggestor implementation essentially is passing a pseudo 
> row with path=/.:
> {code:title=LucenePropertyIndex.java}
> private boolean loadDocs() {
> ...
> queue.add(new LuceneResultRow(suggestedWords));
> ...
> {code}
> and
> {code:title=LucenePropertyIndex.java}
> LuceneResultRow(Iterable suggestWords) {
> this.path = "/";
> this.score = 1.0d;
> this.suggestWords = suggestWords;
> }
> {code}
> Due to path being set to "/", {{SelectorImpl}} later filters out the result 
> as {{rep:root}} (primary type of "/") isn't a {{nt:unstructured}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OAK-3156) Lucene suggestions index definition can't be restricted to a specific type of node

2015-10-12 Thread Vikas Saurabh (JIRA)

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

Vikas Saurabh commented on OAK-3156:


Opened OAK-3509.

> Lucene suggestions index definition can't be restricted to a specific type of 
> node
> --
>
> Key: OAK-3156
> URL: https://issues.apache.org/jira/browse/OAK-3156
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: lucene
>Reporter: Vikas Saurabh
>Assignee: Tommaso Teofili
>Priority: Blocker
> Fix For: 1.3.9
>
> Attachments: LuceneIndexSuggestionTest.java, OAK-3156-take2.patch, 
> OAK-3156.patch
>
>
> While performing a suggestor query like 
> {code}
> SELECT [rep:suggest()] as suggestion  FROM [nt:unstructured] WHERE 
> suggest('foo')
> {code}
> Suggestor does not provide any result. In current implementation, 
> [suggestions|http://jackrabbit.apache.org/oak/docs/query/lucene.html#Suggestions]
>  in Oak work only for index definitions for {{nt:base}} nodetype.
> So, an index definition like:
> {code:xml}
>  jcr:primaryType="oak:QueryIndexDefinition"
> async="async"
> compatVersion="{Long}2"
> type="lucene">
> 
> 
> 
>  jcr:primaryType="nt:unstructured"
> analyzed="{Boolean}true"
> name="description"
> propertyIndex="{Boolean}true"
> useInSuggest="{Boolean}true"/>
> 
> 
> 
> 
> {code}
> works, but if we change nodetype to {{nt:unstructured}} like:
> {code:xml}
>  jcr:primaryType="oak:QueryIndexDefinition"
> async="async"
> compatVersion="{Long}2"
> type="lucene">
> 
> 
> 
>  jcr:primaryType="nt:unstructured"
> analyzed="{Boolean}true"
> name="description"
> propertyIndex="{Boolean}true"
> useInSuggest="{Boolean}true"/>
> 
> 
> 
> 
> {code}
> , it won't work.
> The issue is that suggestor implementation essentially is passing a pseudo 
> row with path=/.:
> {code:title=LucenePropertyIndex.java}
> private boolean loadDocs() {
> ...
> queue.add(new LuceneResultRow(suggestedWords));
> ...
> {code}
> and
> {code:title=LucenePropertyIndex.java}
> LuceneResultRow(Iterable suggestWords) {
> this.path = "/";
> this.score = 1.0d;
> this.suggestWords = suggestWords;
> }
> {code}
> Due to path being set to "/", {{SelectorImpl}} later filters out the result 
> as {{rep:root}} (primary type of "/") isn't a {{nt:unstructured}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OAK-3156) Lucene suggestions index definition can't be restricted to a specific type of node

2015-10-12 Thread Tommaso Teofili (JIRA)

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

Tommaso Teofili commented on OAK-3156:
--

I'll apply this today unless there's any objection from Thomas.

> Lucene suggestions index definition can't be restricted to a specific type of 
> node
> --
>
> Key: OAK-3156
> URL: https://issues.apache.org/jira/browse/OAK-3156
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: lucene
>Reporter: Vikas Saurabh
>Assignee: Tommaso Teofili
>Priority: Blocker
> Fix For: 1.3.9
>
> Attachments: LuceneIndexSuggestionTest.java, OAK-3156-take2.patch, 
> OAK-3156.patch
>
>
> While performing a suggestor query like 
> {code}
> SELECT [rep:suggest()] as suggestion  FROM [nt:unstructured] WHERE 
> suggest('foo')
> {code}
> Suggestor does not provide any result. In current implementation, 
> [suggestions|http://jackrabbit.apache.org/oak/docs/query/lucene.html#Suggestions]
>  in Oak work only for index definitions for {{nt:base}} nodetype.
> So, an index definition like:
> {code:xml}
>  jcr:primaryType="oak:QueryIndexDefinition"
> async="async"
> compatVersion="{Long}2"
> type="lucene">
> 
> 
> 
>  jcr:primaryType="nt:unstructured"
> analyzed="{Boolean}true"
> name="description"
> propertyIndex="{Boolean}true"
> useInSuggest="{Boolean}true"/>
> 
> 
> 
> 
> {code}
> works, but if we change nodetype to {{nt:unstructured}} like:
> {code:xml}
>  jcr:primaryType="oak:QueryIndexDefinition"
> async="async"
> compatVersion="{Long}2"
> type="lucene">
> 
> 
> 
>  jcr:primaryType="nt:unstructured"
> analyzed="{Boolean}true"
> name="description"
> propertyIndex="{Boolean}true"
> useInSuggest="{Boolean}true"/>
> 
> 
> 
> 
> {code}
> , it won't work.
> The issue is that suggestor implementation essentially is passing a pseudo 
> row with path=/.:
> {code:title=LucenePropertyIndex.java}
> private boolean loadDocs() {
> ...
> queue.add(new LuceneResultRow(suggestedWords));
> ...
> {code}
> and
> {code:title=LucenePropertyIndex.java}
> LuceneResultRow(Iterable suggestWords) {
> this.path = "/";
> this.score = 1.0d;
> this.suggestWords = suggestWords;
> }
> {code}
> Due to path being set to "/", {{SelectorImpl}} later filters out the result 
> as {{rep:root}} (primary type of "/") isn't a {{nt:unstructured}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OAK-3156) Lucene suggestions index definition can't be restricted to a specific type of node

2015-10-09 Thread Vikas Saurabh (JIRA)

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

Vikas Saurabh commented on OAK-3156:


[~teofili], [~tmueller], since we are sort of dead locked here - can we go for 
option (1)  (i.e. return a non-null path) to resolve this issue and open a new 
one to say that 'virtual rows must have {{null}} paths'?

> Lucene suggestions index definition can't be restricted to a specific type of 
> node
> --
>
> Key: OAK-3156
> URL: https://issues.apache.org/jira/browse/OAK-3156
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: lucene
>Reporter: Vikas Saurabh
>Assignee: Tommaso Teofili
>Priority: Blocker
> Fix For: 1.3.8
>
> Attachments: LuceneIndexSuggestionTest.java, OAK-3156-take2.patch, 
> OAK-3156.patch
>
>
> While performing a suggestor query like 
> {code}
> SELECT [rep:suggest()] as suggestion  FROM [nt:unstructured] WHERE 
> suggest('foo')
> {code}
> Suggestor does not provide any result. In current implementation, 
> [suggestions|http://jackrabbit.apache.org/oak/docs/query/lucene.html#Suggestions]
>  in Oak work only for index definitions for {{nt:base}} nodetype.
> So, an index definition like:
> {code:xml}
>  jcr:primaryType="oak:QueryIndexDefinition"
> async="async"
> compatVersion="{Long}2"
> type="lucene">
> 
> 
> 
>  jcr:primaryType="nt:unstructured"
> analyzed="{Boolean}true"
> name="description"
> propertyIndex="{Boolean}true"
> useInSuggest="{Boolean}true"/>
> 
> 
> 
> 
> {code}
> works, but if we change nodetype to {{nt:unstructured}} like:
> {code:xml}
>  jcr:primaryType="oak:QueryIndexDefinition"
> async="async"
> compatVersion="{Long}2"
> type="lucene">
> 
> 
> 
>  jcr:primaryType="nt:unstructured"
> analyzed="{Boolean}true"
> name="description"
> propertyIndex="{Boolean}true"
> useInSuggest="{Boolean}true"/>
> 
> 
> 
> 
> {code}
> , it won't work.
> The issue is that suggestor implementation essentially is passing a pseudo 
> row with path=/.:
> {code:title=LucenePropertyIndex.java}
> private boolean loadDocs() {
> ...
> queue.add(new LuceneResultRow(suggestedWords));
> ...
> {code}
> and
> {code:title=LucenePropertyIndex.java}
> LuceneResultRow(Iterable suggestWords) {
> this.path = "/";
> this.score = 1.0d;
> this.suggestWords = suggestWords;
> }
> {code}
> Due to path being set to "/", {{SelectorImpl}} later filters out the result 
> as {{rep:root}} (primary type of "/") isn't a {{nt:unstructured}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OAK-3156) Lucene suggestions index definition can't be restricted to a specific type of node

2015-09-15 Thread Vikas Saurabh (JIRA)

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

Vikas Saurabh commented on OAK-3156:


I meant we maintain the status-quo as today i.e. suggest and spell check 
returns path as '/'. But, they'd also mark the result row as virtual so that 
query engine (selection impl, etc) can decide to ignore it. I understand that 
this is a hack. I was just trying to weigh it in against option#2 which is a 
cleaner (and right) approach but has backward compatibility issue (like we used 
to support xpath suggest till now but won't do anymore... or a query like 
{{SELECT [rep:suggest()] FROM [nt:base] WHERE [jcr:path]='/' AND SUGGEST()}} 
used to work but won't anymore).

> Lucene suggestions index definition can't be restricted to a specific type of 
> node
> --
>
> Key: OAK-3156
> URL: https://issues.apache.org/jira/browse/OAK-3156
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: lucene
>Reporter: Vikas Saurabh
>Assignee: Tommaso Teofili
> Attachments: LuceneIndexSuggestionTest.java, OAK-3156-take2.patch, 
> OAK-3156.patch
>
>
> While performing a suggestor query like 
> {code}
> SELECT [rep:suggest()] as suggestion  FROM [nt:unstructured] WHERE 
> suggest('foo')
> {code}
> Suggestor does not provide any result. In current implementation, 
> [suggestions|http://jackrabbit.apache.org/oak/docs/query/lucene.html#Suggestions]
>  in Oak work only for index definitions for {{nt:base}} nodetype.
> So, an index definition like:
> {code:xml}
>  jcr:primaryType="oak:QueryIndexDefinition"
> async="async"
> compatVersion="{Long}2"
> type="lucene">
> 
> 
> 
>  jcr:primaryType="nt:unstructured"
> analyzed="{Boolean}true"
> name="description"
> propertyIndex="{Boolean}true"
> useInSuggest="{Boolean}true"/>
> 
> 
> 
> 
> {code}
> works, but if we change nodetype to {{nt:unstructured}} like:
> {code:xml}
>  jcr:primaryType="oak:QueryIndexDefinition"
> async="async"
> compatVersion="{Long}2"
> type="lucene">
> 
> 
> 
>  jcr:primaryType="nt:unstructured"
> analyzed="{Boolean}true"
> name="description"
> propertyIndex="{Boolean}true"
> useInSuggest="{Boolean}true"/>
> 
> 
> 
> 
> {code}
> , it won't work.
> The issue is that suggestor implementation essentially is passing a pseudo 
> row with path=/.:
> {code:title=LucenePropertyIndex.java}
> private boolean loadDocs() {
> ...
> queue.add(new LuceneResultRow(suggestedWords));
> ...
> {code}
> and
> {code:title=LucenePropertyIndex.java}
> LuceneResultRow(Iterable suggestWords) {
> this.path = "/";
> this.score = 1.0d;
> this.suggestWords = suggestWords;
> }
> {code}
> Due to path being set to "/", {{SelectorImpl}} later filters out the result 
> as {{rep:root}} (primary type of "/") isn't a {{nt:unstructured}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OAK-3156) Lucene suggestions index definition can't be restricted to a specific type of node

2015-09-15 Thread Thomas Mueller (JIRA)

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

Thomas Mueller commented on OAK-3156:
-

> For the specific case of suggest (and spellcheck) we currently respect the 
> JR2 syntax so we would need to document that from version x.y.z suggest / 
> spellcheck queries has to be formulated / consumed in a different way.

Could you add a link to the most up-to-date documentation? I don't know where 
to find that sorry.

> we would need to document that from version x.y.z suggest / spellcheck 
> queries has to be formulated / consumed in a different way.

Yes, that would be needed... but it might be easier to do that, instead of 
trying to find a huge workaround inside Oak, in order to provide backward 
compatibility.

> SELECT [rep:suggest()] FROM [app:Asset] AS s WHERE SUGGEST() AND 
> ISDESCENDANTNODE(s, [/content/subPath1])

To me, such a query looks like it returns one row per node, and it looks like 
there is in fact a path.



> Lucene suggestions index definition can't be restricted to a specific type of 
> node
> --
>
> Key: OAK-3156
> URL: https://issues.apache.org/jira/browse/OAK-3156
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: lucene
>Reporter: Vikas Saurabh
>Assignee: Tommaso Teofili
> Attachments: LuceneIndexSuggestionTest.java, OAK-3156-take2.patch, 
> OAK-3156.patch
>
>
> While performing a suggestor query like 
> {code}
> SELECT [rep:suggest()] as suggestion  FROM [nt:unstructured] WHERE 
> suggest('foo')
> {code}
> Suggestor does not provide any result. In current implementation, 
> [suggestions|http://jackrabbit.apache.org/oak/docs/query/lucene.html#Suggestions]
>  in Oak work only for index definitions for {{nt:base}} nodetype.
> So, an index definition like:
> {code:xml}
>  jcr:primaryType="oak:QueryIndexDefinition"
> async="async"
> compatVersion="{Long}2"
> type="lucene">
> 
> 
> 
>  jcr:primaryType="nt:unstructured"
> analyzed="{Boolean}true"
> name="description"
> propertyIndex="{Boolean}true"
> useInSuggest="{Boolean}true"/>
> 
> 
> 
> 
> {code}
> works, but if we change nodetype to {{nt:unstructured}} like:
> {code:xml}
>  jcr:primaryType="oak:QueryIndexDefinition"
> async="async"
> compatVersion="{Long}2"
> type="lucene">
> 
> 
> 
>  jcr:primaryType="nt:unstructured"
> analyzed="{Boolean}true"
> name="description"
> propertyIndex="{Boolean}true"
> useInSuggest="{Boolean}true"/>
> 
> 
> 
> 
> {code}
> , it won't work.
> The issue is that suggestor implementation essentially is passing a pseudo 
> row with path=/.:
> {code:title=LucenePropertyIndex.java}
> private boolean loadDocs() {
> ...
> queue.add(new LuceneResultRow(suggestedWords));
> ...
> {code}
> and
> {code:title=LucenePropertyIndex.java}
> LuceneResultRow(Iterable suggestWords) {
> this.path = "/";
> this.score = 1.0d;
> this.suggestWords = suggestWords;
> }
> {code}
> Due to path being set to "/", {{SelectorImpl}} later filters out the result 
> as {{rep:root}} (primary type of "/") isn't a {{nt:unstructured}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OAK-3156) Lucene suggestions index definition can't be restricted to a specific type of node

2015-09-15 Thread Vikas Saurabh (JIRA)

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

Vikas Saurabh commented on OAK-3156:


{quote}
> SELECT [rep:suggest()] FROM [app:Asset] AS s WHERE SUGGEST() AND 
> ISDESCENDANTNODE(s, [/content/subPath1])
To me, such a query looks like it returns one row per node, and it looks like 
there is in fact a path.
{quote}
ok, yes we might have to come up with a new syntax. What I meant was it's 
useful case to ask for suggestions under a sub-tree. I agree a condition like 
{{WHERE [jcr:path]='/'}} is wrong when asking for suggestions.

> Lucene suggestions index definition can't be restricted to a specific type of 
> node
> --
>
> Key: OAK-3156
> URL: https://issues.apache.org/jira/browse/OAK-3156
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: lucene
>Reporter: Vikas Saurabh
>Assignee: Tommaso Teofili
> Attachments: LuceneIndexSuggestionTest.java, OAK-3156-take2.patch, 
> OAK-3156.patch
>
>
> While performing a suggestor query like 
> {code}
> SELECT [rep:suggest()] as suggestion  FROM [nt:unstructured] WHERE 
> suggest('foo')
> {code}
> Suggestor does not provide any result. In current implementation, 
> [suggestions|http://jackrabbit.apache.org/oak/docs/query/lucene.html#Suggestions]
>  in Oak work only for index definitions for {{nt:base}} nodetype.
> So, an index definition like:
> {code:xml}
>  jcr:primaryType="oak:QueryIndexDefinition"
> async="async"
> compatVersion="{Long}2"
> type="lucene">
> 
> 
> 
>  jcr:primaryType="nt:unstructured"
> analyzed="{Boolean}true"
> name="description"
> propertyIndex="{Boolean}true"
> useInSuggest="{Boolean}true"/>
> 
> 
> 
> 
> {code}
> works, but if we change nodetype to {{nt:unstructured}} like:
> {code:xml}
>  jcr:primaryType="oak:QueryIndexDefinition"
> async="async"
> compatVersion="{Long}2"
> type="lucene">
> 
> 
> 
>  jcr:primaryType="nt:unstructured"
> analyzed="{Boolean}true"
> name="description"
> propertyIndex="{Boolean}true"
> useInSuggest="{Boolean}true"/>
> 
> 
> 
> 
> {code}
> , it won't work.
> The issue is that suggestor implementation essentially is passing a pseudo 
> row with path=/.:
> {code:title=LucenePropertyIndex.java}
> private boolean loadDocs() {
> ...
> queue.add(new LuceneResultRow(suggestedWords));
> ...
> {code}
> and
> {code:title=LucenePropertyIndex.java}
> LuceneResultRow(Iterable suggestWords) {
> this.path = "/";
> this.score = 1.0d;
> this.suggestWords = suggestWords;
> }
> {code}
> Due to path being set to "/", {{SelectorImpl}} later filters out the result 
> as {{rep:root}} (primary type of "/") isn't a {{nt:unstructured}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OAK-3156) Lucene suggestions index definition can't be restricted to a specific type of node

2015-09-15 Thread Thomas Mueller (JIRA)

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

Thomas Mueller commented on OAK-3156:
-

> Make suggest queries to return paths

OK, what path would we return? What about access rights (let's say we return 
"/" and the user may not read from that node)?

> Lucene suggestions index definition can't be restricted to a specific type of 
> node
> --
>
> Key: OAK-3156
> URL: https://issues.apache.org/jira/browse/OAK-3156
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: lucene
>Reporter: Vikas Saurabh
>Assignee: Tommaso Teofili
> Attachments: LuceneIndexSuggestionTest.java, OAK-3156-take2.patch, 
> OAK-3156.patch
>
>
> While performing a suggestor query like 
> {code}
> SELECT [rep:suggest()] as suggestion  FROM [nt:unstructured] WHERE 
> suggest('foo')
> {code}
> Suggestor does not provide any result. In current implementation, 
> [suggestions|http://jackrabbit.apache.org/oak/docs/query/lucene.html#Suggestions]
>  in Oak work only for index definitions for {{nt:base}} nodetype.
> So, an index definition like:
> {code:xml}
>  jcr:primaryType="oak:QueryIndexDefinition"
> async="async"
> compatVersion="{Long}2"
> type="lucene">
> 
> 
> 
>  jcr:primaryType="nt:unstructured"
> analyzed="{Boolean}true"
> name="description"
> propertyIndex="{Boolean}true"
> useInSuggest="{Boolean}true"/>
> 
> 
> 
> 
> {code}
> works, but if we change nodetype to {{nt:unstructured}} like:
> {code:xml}
>  jcr:primaryType="oak:QueryIndexDefinition"
> async="async"
> compatVersion="{Long}2"
> type="lucene">
> 
> 
> 
>  jcr:primaryType="nt:unstructured"
> analyzed="{Boolean}true"
> name="description"
> propertyIndex="{Boolean}true"
> useInSuggest="{Boolean}true"/>
> 
> 
> 
> 
> {code}
> , it won't work.
> The issue is that suggestor implementation essentially is passing a pseudo 
> row with path=/.:
> {code:title=LucenePropertyIndex.java}
> private boolean loadDocs() {
> ...
> queue.add(new LuceneResultRow(suggestedWords));
> ...
> {code}
> and
> {code:title=LucenePropertyIndex.java}
> LuceneResultRow(Iterable suggestWords) {
> this.path = "/";
> this.score = 1.0d;
> this.suggestWords = suggestWords;
> }
> {code}
> Due to path being set to "/", {{SelectorImpl}} later filters out the result 
> as {{rep:root}} (primary type of "/") isn't a {{nt:unstructured}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OAK-3156) Lucene suggestions index definition can't be restricted to a specific type of node

2015-09-04 Thread Vikas Saurabh (JIRA)

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

Vikas Saurabh commented on OAK-3156:


[~tmueller], [~teofili] can we get to a consensus about which approach to take:
# Make suggest queries to return paths and fix {{isVirtual}} documentation to 
state that virtual rows can have non-null/non-"" paths while the semantics of 
those paths are undefined
# Unsupport xpath for suggest query and remove test case + remove {{WHERE 
jcr:path='/'}} conditions from sql ones (I think we'd need to update 
documentation as well... not sure of its process though... do we need to 
deprecate first before removing support?)

The [patch|^OAK-3156-take2.patch] implements option#1 above (without 
documentation fix). If required I can prepare a patch for option#2.

> Lucene suggestions index definition can't be restricted to a specific type of 
> node
> --
>
> Key: OAK-3156
> URL: https://issues.apache.org/jira/browse/OAK-3156
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: lucene
>Reporter: Vikas Saurabh
>Assignee: Tommaso Teofili
> Attachments: LuceneIndexSuggestionTest.java, OAK-3156-take2.patch, 
> OAK-3156.patch
>
>
> While performing a suggestor query like 
> {code}
> SELECT [rep:suggest()] as suggestion  FROM [nt:unstructured] WHERE 
> suggest('foo')
> {code}
> Suggestor does not provide any result. In current implementation, 
> [suggestions|http://jackrabbit.apache.org/oak/docs/query/lucene.html#Suggestions]
>  in Oak work only for index definitions for {{nt:base}} nodetype.
> So, an index definition like:
> {code:xml}
>  jcr:primaryType="oak:QueryIndexDefinition"
> async="async"
> compatVersion="{Long}2"
> type="lucene">
> 
> 
> 
>  jcr:primaryType="nt:unstructured"
> analyzed="{Boolean}true"
> name="description"
> propertyIndex="{Boolean}true"
> useInSuggest="{Boolean}true"/>
> 
> 
> 
> 
> {code}
> works, but if we change nodetype to {{nt:unstructured}} like:
> {code:xml}
>  jcr:primaryType="oak:QueryIndexDefinition"
> async="async"
> compatVersion="{Long}2"
> type="lucene">
> 
> 
> 
>  jcr:primaryType="nt:unstructured"
> analyzed="{Boolean}true"
> name="description"
> propertyIndex="{Boolean}true"
> useInSuggest="{Boolean}true"/>
> 
> 
> 
> 
> {code}
> , it won't work.
> The issue is that suggestor implementation essentially is passing a pseudo 
> row with path=/.:
> {code:title=LucenePropertyIndex.java}
> private boolean loadDocs() {
> ...
> queue.add(new LuceneResultRow(suggestedWords));
> ...
> {code}
> and
> {code:title=LucenePropertyIndex.java}
> LuceneResultRow(Iterable suggestWords) {
> this.path = "/";
> this.score = 1.0d;
> this.suggestWords = suggestWords;
> }
> {code}
> Due to path being set to "/", {{SelectorImpl}} later filters out the result 
> as {{rep:root}} (primary type of "/") isn't a {{nt:unstructured}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OAK-3156) Lucene suggestions index definition can't be restricted to a specific type of node

2015-09-02 Thread Thomas Mueller (JIRA)

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

Thomas Mueller commented on OAK-3156:
-

I'm not sure if we need to support xpath (and if yes: how). Also, I'm not sure 
if we need to support "select ... from [nt:unstructured]" with "suggest" 
queries. Couldn't you just use "from [nt:base]"?

I guess we need to decide what we want to support, and why. One reason could be 
compatibility with Jackrabbit 2.x. As for xpath support: in my view, xpath is 
the "high level" query language, and sql-2 is the "low level" language. For 
"suggest" queries, those don't return nodes really, do we need to support 
xpath? Why?

> Lucene suggestions index definition can't be restricted to a specific type of 
> node
> --
>
> Key: OAK-3156
> URL: https://issues.apache.org/jira/browse/OAK-3156
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: lucene
>Reporter: Vikas Saurabh
>Assignee: Tommaso Teofili
> Attachments: LuceneIndexSuggestionTest.java, OAK-3156-take2.patch, 
> OAK-3156.patch
>
>
> While performing a suggestor query like 
> {code}
> SELECT [rep:suggest()] as suggestion  FROM [nt:unstructured] WHERE 
> suggest('foo')
> {code}
> Suggestor does not provide any result. In current implementation, 
> [suggestions|http://jackrabbit.apache.org/oak/docs/query/lucene.html#Suggestions]
>  in Oak work only for index definitions for {{nt:base}} nodetype.
> So, an index definition like:
> {code:xml}
>  jcr:primaryType="oak:QueryIndexDefinition"
> async="async"
> compatVersion="{Long}2"
> type="lucene">
> 
> 
> 
>  jcr:primaryType="nt:unstructured"
> analyzed="{Boolean}true"
> name="description"
> propertyIndex="{Boolean}true"
> useInSuggest="{Boolean}true"/>
> 
> 
> 
> 
> {code}
> works, but if we change nodetype to {{nt:unstructured}} like:
> {code:xml}
>  jcr:primaryType="oak:QueryIndexDefinition"
> async="async"
> compatVersion="{Long}2"
> type="lucene">
> 
> 
> 
>  jcr:primaryType="nt:unstructured"
> analyzed="{Boolean}true"
> name="description"
> propertyIndex="{Boolean}true"
> useInSuggest="{Boolean}true"/>
> 
> 
> 
> 
> {code}
> , it won't work.
> The issue is that suggestor implementation essentially is passing a pseudo 
> row with path=/.:
> {code:title=LucenePropertyIndex.java}
> private boolean loadDocs() {
> ...
> queue.add(new LuceneResultRow(suggestedWords));
> ...
> {code}
> and
> {code:title=LucenePropertyIndex.java}
> LuceneResultRow(Iterable suggestWords) {
> this.path = "/";
> this.score = 1.0d;
> this.suggestWords = suggestWords;
> }
> {code}
> Due to path being set to "/", {{SelectorImpl}} later filters out the result 
> as {{rep:root}} (primary type of "/") isn't a {{nt:unstructured}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OAK-3156) Lucene suggestions index definition can't be restricted to a specific type of node

2015-09-02 Thread Vikas Saurabh (JIRA)

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

Vikas Saurabh commented on OAK-3156:


I'm not sure of support for xpath wrt to suggest/spellcheck. But, I think 
querying over higher level nodes under a sub-path can be useful. e.g. 
{noformat}
SELECT [rep:spellcheck()] FROM [app:Asset] AS s WHERE SPELLCHECK('helo') AND 
ISDESCENDANTNODE(s, [/content/subPath1])
{noformat}
to imply looking at suggestions from nodes of type app:Asset or sub-types and 
under /content/subPath1. I know, I'm jumping the gun here for a feature which 
doesn't exist current -- I just wanted to mention that it might make sense to 
work on specific types of nodes under certain paths... I think for all cases 
those parameters would be useful only for picking the correct index.

> Lucene suggestions index definition can't be restricted to a specific type of 
> node
> --
>
> Key: OAK-3156
> URL: https://issues.apache.org/jira/browse/OAK-3156
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: lucene
>Reporter: Vikas Saurabh
>Assignee: Tommaso Teofili
> Attachments: LuceneIndexSuggestionTest.java, OAK-3156-take2.patch, 
> OAK-3156.patch
>
>
> While performing a suggestor query like 
> {code}
> SELECT [rep:suggest()] as suggestion  FROM [nt:unstructured] WHERE 
> suggest('foo')
> {code}
> Suggestor does not provide any result. In current implementation, 
> [suggestions|http://jackrabbit.apache.org/oak/docs/query/lucene.html#Suggestions]
>  in Oak work only for index definitions for {{nt:base}} nodetype.
> So, an index definition like:
> {code:xml}
>  jcr:primaryType="oak:QueryIndexDefinition"
> async="async"
> compatVersion="{Long}2"
> type="lucene">
> 
> 
> 
>  jcr:primaryType="nt:unstructured"
> analyzed="{Boolean}true"
> name="description"
> propertyIndex="{Boolean}true"
> useInSuggest="{Boolean}true"/>
> 
> 
> 
> 
> {code}
> works, but if we change nodetype to {{nt:unstructured}} like:
> {code:xml}
>  jcr:primaryType="oak:QueryIndexDefinition"
> async="async"
> compatVersion="{Long}2"
> type="lucene">
> 
> 
> 
>  jcr:primaryType="nt:unstructured"
> analyzed="{Boolean}true"
> name="description"
> propertyIndex="{Boolean}true"
> useInSuggest="{Boolean}true"/>
> 
> 
> 
> 
> {code}
> , it won't work.
> The issue is that suggestor implementation essentially is passing a pseudo 
> row with path=/.:
> {code:title=LucenePropertyIndex.java}
> private boolean loadDocs() {
> ...
> queue.add(new LuceneResultRow(suggestedWords));
> ...
> {code}
> and
> {code:title=LucenePropertyIndex.java}
> LuceneResultRow(Iterable suggestWords) {
> this.path = "/";
> this.score = 1.0d;
> this.suggestWords = suggestWords;
> }
> {code}
> Due to path being set to "/", {{SelectorImpl}} later filters out the result 
> as {{rep:root}} (primary type of "/") isn't a {{nt:unstructured}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OAK-3156) Lucene suggestions index definition can't be restricted to a specific type of node

2015-08-26 Thread Vikas Saurabh (JIRA)

[ 
https://issues.apache.org/jira/browse/OAK-3156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14713077#comment-14713077
 ] 

Vikas Saurabh commented on OAK-3156:


Now that OAK-3230 has been resolved, [~chetanm],[~teofili] can one of you guys 
please review the attached patch. 

 Lucene suggestions index definition can't be restricted to a specific type of 
 node
 --

 Key: OAK-3156
 URL: https://issues.apache.org/jira/browse/OAK-3156
 Project: Jackrabbit Oak
  Issue Type: Bug
  Components: lucene
Reporter: Vikas Saurabh
Assignee: Tommaso Teofili
 Attachments: LuceneIndexSuggestionTest.java, OAK-3156.patch


 While performing a suggestor query like 
 {code}
 SELECT [rep:suggest()] as suggestion  FROM [nt:unstructured] WHERE 
 suggest('foo')
 {code}
 Suggestor does not provide any result. In current implementation, 
 [suggestions|http://jackrabbit.apache.org/oak/docs/query/lucene.html#Suggestions]
  in Oak work only for index definitions for {{nt:base}} nodetype.
 So, an index definition like:
 {code:xml}
 lucene-suggest
 jcr:primaryType=oak:QueryIndexDefinition
 async=async
 compatVersion={Long}2
 type=lucene
 indexRules jcr:primaryType=nt:unstructured
 nt:base jcr:primaryType=nt:unstructured
 properties jcr:primaryType=nt:unstructured
 description
 jcr:primaryType=nt:unstructured
 analyzed={Boolean}true
 name=description
 propertyIndex={Boolean}true
 useInSuggest={Boolean}true/
 /properties
 /nt:base
 /indexRules
 /lucene-suggest
 {code}
 works, but if we change nodetype to {{nt:unstructured}} like:
 {code:xml}
 lucene-suggest
 jcr:primaryType=oak:QueryIndexDefinition
 async=async
 compatVersion={Long}2
 type=lucene
 indexRules jcr:primaryType=nt:unstructured
 nt:unstructured jcr:primaryType=nt:unstructured
 properties jcr:primaryType=nt:unstructured
 description
 jcr:primaryType=nt:unstructured
 analyzed={Boolean}true
 name=description
 propertyIndex={Boolean}true
 useInSuggest={Boolean}true/
 /properties
 /nt:base
 /indexRules
 /lucene-suggest
 {code}
 , it won't work.
 The issue is that suggestor implementation essentially is passing a pseudo 
 row with path=/.:
 {code:title=LucenePropertyIndex.java}
 private boolean loadDocs() {
 ...
 queue.add(new LuceneResultRow(suggestedWords));
 ...
 {code}
 and
 {code:title=LucenePropertyIndex.java}
 LuceneResultRow(IterableString suggestWords) {
 this.path = /;
 this.score = 1.0d;
 this.suggestWords = suggestWords;
 }
 {code}
 Due to path being set to /, {{SelectorImpl}} later filters out the result 
 as {{rep:root}} (primary type of /) isn't a {{nt:unstructured}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OAK-3156) Lucene suggestions index definition can't be restricted to a specific type of node

2015-08-14 Thread Vikas Saurabh (JIRA)

[ 
https://issues.apache.org/jira/browse/OAK-3156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14696791#comment-14696791
 ] 

Vikas Saurabh commented on OAK-3156:


Opened OAK-3230 - the patch adds a new method ({{isVirtualRow}}) to 
{{IndexRow}} to clearly mark the intent of row being virtual.

 Lucene suggestions index definition can't be restricted to a specific type of 
 node
 --

 Key: OAK-3156
 URL: https://issues.apache.org/jira/browse/OAK-3156
 Project: Jackrabbit Oak
  Issue Type: Bug
  Components: lucene
Reporter: Vikas Saurabh
Assignee: Tommaso Teofili
 Attachments: LuceneIndexSuggestionTest.java


 While performing a suggestor query like 
 {code}
 SELECT [rep:suggest()] as suggestion  FROM [nt:unstructured] WHERE 
 suggest('foo')
 {code}
 Suggestor does not provide any result. In current implementation, 
 [suggestions|http://jackrabbit.apache.org/oak/docs/query/lucene.html#Suggestions]
  in Oak work only for index definitions for {{nt:base}} nodetype.
 So, an index definition like:
 {code:xml}
 lucene-suggest
 jcr:primaryType=oak:QueryIndexDefinition
 async=async
 compatVersion={Long}2
 type=lucene
 indexRules jcr:primaryType=nt:unstructured
 nt:base jcr:primaryType=nt:unstructured
 properties jcr:primaryType=nt:unstructured
 description
 jcr:primaryType=nt:unstructured
 analyzed={Boolean}true
 name=description
 propertyIndex={Boolean}true
 useInSuggest={Boolean}true/
 /properties
 /nt:base
 /indexRules
 /lucene-suggest
 {code}
 works, but if we change nodetype to {{nt:unstructured}} like:
 {code:xml}
 lucene-suggest
 jcr:primaryType=oak:QueryIndexDefinition
 async=async
 compatVersion={Long}2
 type=lucene
 indexRules jcr:primaryType=nt:unstructured
 nt:unstructured jcr:primaryType=nt:unstructured
 properties jcr:primaryType=nt:unstructured
 description
 jcr:primaryType=nt:unstructured
 analyzed={Boolean}true
 name=description
 propertyIndex={Boolean}true
 useInSuggest={Boolean}true/
 /properties
 /nt:base
 /indexRules
 /lucene-suggest
 {code}
 , it won't work.
 The issue is that suggestor implementation essentially is passing a pseudo 
 row with path=/.:
 {code:title=LucenePropertyIndex.java}
 private boolean loadDocs() {
 ...
 queue.add(new LuceneResultRow(suggestedWords));
 ...
 {code}
 and
 {code:title=LucenePropertyIndex.java}
 LuceneResultRow(IterableString suggestWords) {
 this.path = /;
 this.score = 1.0d;
 this.suggestWords = suggestWords;
 }
 {code}
 Due to path being set to /, {{SelectorImpl}} later filters out the result 
 as {{rep:root}} (primary type of /) isn't a {{nt:unstructured}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OAK-3156) Lucene suggestions index definition can't be restricted to a specific type of node

2015-08-12 Thread Vikas Saurabh (JIRA)

[ 
https://issues.apache.org/jira/browse/OAK-3156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14693240#comment-14693240
 ] 

Vikas Saurabh commented on OAK-3156:


btw, this also diverges from the current query model where we can say
{noformat}
SELECT [rep:suggest()] as suggestion  FROM [test:Asset] WHERE suggest('in')
{noformat}
This doesn't specify any path (and hence currently queries on root).

Even if we have a path restriction, I think the intent of path restriction has 
always been 'give the redable' rows under this path - the path itself 
might/might not be redable.

 Lucene suggestions index definition can't be restricted to a specific type of 
 node
 --

 Key: OAK-3156
 URL: https://issues.apache.org/jira/browse/OAK-3156
 Project: Jackrabbit Oak
  Issue Type: Bug
  Components: lucene
Reporter: Vikas Saurabh
Assignee: Tommaso Teofili
 Attachments: LuceneIndexSuggestionTest.java


 While performing a suggestor query like 
 {code}
 SELECT [rep:suggest()] as suggestion  FROM [nt:unstructured] WHERE 
 suggest('foo')
 {code}
 Suggestor does not provide any result. In current implementation, 
 [suggestions|http://jackrabbit.apache.org/oak/docs/query/lucene.html#Suggestions]
  in Oak work only for index definitions for {{nt:base}} nodetype.
 So, an index definition like:
 {code:xml}
 lucene-suggest
 jcr:primaryType=oak:QueryIndexDefinition
 async=async
 compatVersion={Long}2
 type=lucene
 indexRules jcr:primaryType=nt:unstructured
 nt:base jcr:primaryType=nt:unstructured
 properties jcr:primaryType=nt:unstructured
 description
 jcr:primaryType=nt:unstructured
 analyzed={Boolean}true
 name=description
 propertyIndex={Boolean}true
 useInSuggest={Boolean}true/
 /properties
 /nt:base
 /indexRules
 /lucene-suggest
 {code}
 works, but if we change nodetype to {{nt:unstructured}} like:
 {code:xml}
 lucene-suggest
 jcr:primaryType=oak:QueryIndexDefinition
 async=async
 compatVersion={Long}2
 type=lucene
 indexRules jcr:primaryType=nt:unstructured
 nt:unstructured jcr:primaryType=nt:unstructured
 properties jcr:primaryType=nt:unstructured
 description
 jcr:primaryType=nt:unstructured
 analyzed={Boolean}true
 name=description
 propertyIndex={Boolean}true
 useInSuggest={Boolean}true/
 /properties
 /nt:base
 /indexRules
 /lucene-suggest
 {code}
 , it won't work.
 The issue is that suggestor implementation essentially is passing a pseudo 
 row with path=/.:
 {code:title=LucenePropertyIndex.java}
 private boolean loadDocs() {
 ...
 queue.add(new LuceneResultRow(suggestedWords));
 ...
 {code}
 and
 {code:title=LucenePropertyIndex.java}
 LuceneResultRow(IterableString suggestWords) {
 this.path = /;
 this.score = 1.0d;
 this.suggestWords = suggestWords;
 }
 {code}
 Due to path being set to /, {{SelectorImpl}} later filters out the result 
 as {{rep:root}} (primary type of /) isn't a {{nt:unstructured}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OAK-3156) Lucene suggestions index definition can't be restricted to a specific type of node

2015-08-12 Thread Tommaso Teofili (JIRA)

[ 
https://issues.apache.org/jira/browse/OAK-3156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14693238#comment-14693238
 ] 

Tommaso Teofili commented on OAK-3156:
--

sure, that I think needs to be fixed with a special handling for such kind of 
queries (spellcheck / suggest)

 Lucene suggestions index definition can't be restricted to a specific type of 
 node
 --

 Key: OAK-3156
 URL: https://issues.apache.org/jira/browse/OAK-3156
 Project: Jackrabbit Oak
  Issue Type: Bug
  Components: lucene
Reporter: Vikas Saurabh
Assignee: Tommaso Teofili
 Attachments: LuceneIndexSuggestionTest.java


 While performing a suggestor query like 
 {code}
 SELECT [rep:suggest()] as suggestion  FROM [nt:unstructured] WHERE 
 suggest('foo')
 {code}
 Suggestor does not provide any result. In current implementation, 
 [suggestions|http://jackrabbit.apache.org/oak/docs/query/lucene.html#Suggestions]
  in Oak work only for index definitions for {{nt:base}} nodetype.
 So, an index definition like:
 {code:xml}
 lucene-suggest
 jcr:primaryType=oak:QueryIndexDefinition
 async=async
 compatVersion={Long}2
 type=lucene
 indexRules jcr:primaryType=nt:unstructured
 nt:base jcr:primaryType=nt:unstructured
 properties jcr:primaryType=nt:unstructured
 description
 jcr:primaryType=nt:unstructured
 analyzed={Boolean}true
 name=description
 propertyIndex={Boolean}true
 useInSuggest={Boolean}true/
 /properties
 /nt:base
 /indexRules
 /lucene-suggest
 {code}
 works, but if we change nodetype to {{nt:unstructured}} like:
 {code:xml}
 lucene-suggest
 jcr:primaryType=oak:QueryIndexDefinition
 async=async
 compatVersion={Long}2
 type=lucene
 indexRules jcr:primaryType=nt:unstructured
 nt:unstructured jcr:primaryType=nt:unstructured
 properties jcr:primaryType=nt:unstructured
 description
 jcr:primaryType=nt:unstructured
 analyzed={Boolean}true
 name=description
 propertyIndex={Boolean}true
 useInSuggest={Boolean}true/
 /properties
 /nt:base
 /indexRules
 /lucene-suggest
 {code}
 , it won't work.
 The issue is that suggestor implementation essentially is passing a pseudo 
 row with path=/.:
 {code:title=LucenePropertyIndex.java}
 private boolean loadDocs() {
 ...
 queue.add(new LuceneResultRow(suggestedWords));
 ...
 {code}
 and
 {code:title=LucenePropertyIndex.java}
 LuceneResultRow(IterableString suggestWords) {
 this.path = /;
 this.score = 1.0d;
 this.suggestWords = suggestWords;
 }
 {code}
 Due to path being set to /, {{SelectorImpl}} later filters out the result 
 as {{rep:root}} (primary type of /) isn't a {{nt:unstructured}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OAK-3156) Lucene suggestions index definition can't be restricted to a specific type of node

2015-08-12 Thread Tommaso Teofili (JIRA)

[ 
https://issues.apache.org/jira/browse/OAK-3156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14693237#comment-14693237
 ] 

Tommaso Teofili commented on OAK-3156:
--

sure, that I think needs to be fixed with a special handling for such kind of 
queries (spellcheck / suggest)

 Lucene suggestions index definition can't be restricted to a specific type of 
 node
 --

 Key: OAK-3156
 URL: https://issues.apache.org/jira/browse/OAK-3156
 Project: Jackrabbit Oak
  Issue Type: Bug
  Components: lucene
Reporter: Vikas Saurabh
Assignee: Tommaso Teofili
 Attachments: LuceneIndexSuggestionTest.java


 While performing a suggestor query like 
 {code}
 SELECT [rep:suggest()] as suggestion  FROM [nt:unstructured] WHERE 
 suggest('foo')
 {code}
 Suggestor does not provide any result. In current implementation, 
 [suggestions|http://jackrabbit.apache.org/oak/docs/query/lucene.html#Suggestions]
  in Oak work only for index definitions for {{nt:base}} nodetype.
 So, an index definition like:
 {code:xml}
 lucene-suggest
 jcr:primaryType=oak:QueryIndexDefinition
 async=async
 compatVersion={Long}2
 type=lucene
 indexRules jcr:primaryType=nt:unstructured
 nt:base jcr:primaryType=nt:unstructured
 properties jcr:primaryType=nt:unstructured
 description
 jcr:primaryType=nt:unstructured
 analyzed={Boolean}true
 name=description
 propertyIndex={Boolean}true
 useInSuggest={Boolean}true/
 /properties
 /nt:base
 /indexRules
 /lucene-suggest
 {code}
 works, but if we change nodetype to {{nt:unstructured}} like:
 {code:xml}
 lucene-suggest
 jcr:primaryType=oak:QueryIndexDefinition
 async=async
 compatVersion={Long}2
 type=lucene
 indexRules jcr:primaryType=nt:unstructured
 nt:unstructured jcr:primaryType=nt:unstructured
 properties jcr:primaryType=nt:unstructured
 description
 jcr:primaryType=nt:unstructured
 analyzed={Boolean}true
 name=description
 propertyIndex={Boolean}true
 useInSuggest={Boolean}true/
 /properties
 /nt:base
 /indexRules
 /lucene-suggest
 {code}
 , it won't work.
 The issue is that suggestor implementation essentially is passing a pseudo 
 row with path=/.:
 {code:title=LucenePropertyIndex.java}
 private boolean loadDocs() {
 ...
 queue.add(new LuceneResultRow(suggestedWords));
 ...
 {code}
 and
 {code:title=LucenePropertyIndex.java}
 LuceneResultRow(IterableString suggestWords) {
 this.path = /;
 this.score = 1.0d;
 this.suggestWords = suggestWords;
 }
 {code}
 Due to path being set to /, {{SelectorImpl}} later filters out the result 
 as {{rep:root}} (primary type of /) isn't a {{nt:unstructured}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OAK-3156) Lucene suggestions index definition can't be restricted to a specific type of node

2015-08-12 Thread Vikas Saurabh (JIRA)

[ 
https://issues.apache.org/jira/browse/OAK-3156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14693234#comment-14693234
 ] 

Vikas Saurabh commented on OAK-3156:


That would still just solve the permission issue. Final rows would still be 
tried to be compared with primary type of node being queried and which might 
not match with the node types being queried -- like if we query for suggestion 
on test:Asset under /content then we probably won't want a requirement that 
/content need to be a sub-type of test:Asset.

 Lucene suggestions index definition can't be restricted to a specific type of 
 node
 --

 Key: OAK-3156
 URL: https://issues.apache.org/jira/browse/OAK-3156
 Project: Jackrabbit Oak
  Issue Type: Bug
  Components: lucene
Reporter: Vikas Saurabh
Assignee: Tommaso Teofili
 Attachments: LuceneIndexSuggestionTest.java


 While performing a suggestor query like 
 {code}
 SELECT [rep:suggest()] as suggestion  FROM [nt:unstructured] WHERE 
 suggest('foo')
 {code}
 Suggestor does not provide any result. In current implementation, 
 [suggestions|http://jackrabbit.apache.org/oak/docs/query/lucene.html#Suggestions]
  in Oak work only for index definitions for {{nt:base}} nodetype.
 So, an index definition like:
 {code:xml}
 lucene-suggest
 jcr:primaryType=oak:QueryIndexDefinition
 async=async
 compatVersion={Long}2
 type=lucene
 indexRules jcr:primaryType=nt:unstructured
 nt:base jcr:primaryType=nt:unstructured
 properties jcr:primaryType=nt:unstructured
 description
 jcr:primaryType=nt:unstructured
 analyzed={Boolean}true
 name=description
 propertyIndex={Boolean}true
 useInSuggest={Boolean}true/
 /properties
 /nt:base
 /indexRules
 /lucene-suggest
 {code}
 works, but if we change nodetype to {{nt:unstructured}} like:
 {code:xml}
 lucene-suggest
 jcr:primaryType=oak:QueryIndexDefinition
 async=async
 compatVersion={Long}2
 type=lucene
 indexRules jcr:primaryType=nt:unstructured
 nt:unstructured jcr:primaryType=nt:unstructured
 properties jcr:primaryType=nt:unstructured
 description
 jcr:primaryType=nt:unstructured
 analyzed={Boolean}true
 name=description
 propertyIndex={Boolean}true
 useInSuggest={Boolean}true/
 /properties
 /nt:base
 /indexRules
 /lucene-suggest
 {code}
 , it won't work.
 The issue is that suggestor implementation essentially is passing a pseudo 
 row with path=/.:
 {code:title=LucenePropertyIndex.java}
 private boolean loadDocs() {
 ...
 queue.add(new LuceneResultRow(suggestedWords));
 ...
 {code}
 and
 {code:title=LucenePropertyIndex.java}
 LuceneResultRow(IterableString suggestWords) {
 this.path = /;
 this.score = 1.0d;
 this.suggestWords = suggestWords;
 }
 {code}
 Due to path being set to /, {{SelectorImpl}} later filters out the result 
 as {{rep:root}} (primary type of /) isn't a {{nt:unstructured}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OAK-3156) Lucene suggestions index definition can't be restricted to a specific type of node

2015-08-05 Thread Thomas Mueller (JIRA)

[ 
https://issues.apache.org/jira/browse/OAK-3156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14655273#comment-14655273
 ] 

Thomas Mueller commented on OAK-3156:
-

I guess it would make sense to use path = , or path = null, instead of path = 
/. This will probably need a change in the query engine.

 Lucene suggestions index definition can't be restricted to a specific type of 
 node
 --

 Key: OAK-3156
 URL: https://issues.apache.org/jira/browse/OAK-3156
 Project: Jackrabbit Oak
  Issue Type: Bug
  Components: lucene
Reporter: Vikas Saurabh
Assignee: Tommaso Teofili
 Attachments: LuceneIndexSuggestionTest.java


 While performing a suggestor query like 
 {code}
 SELECT [rep:suggest()] as suggestion  FROM [nt:unstructured] WHERE 
 suggest('foo')
 {code}
 Suggestor does not provide any result. In current implementation, 
 [suggestions|http://jackrabbit.apache.org/oak/docs/query/lucene.html#Suggestions]
  in Oak work only for index definitions for {{nt:base}} nodetype.
 So, an index definition like:
 {code:xml}
 lucene-suggest
 jcr:primaryType=oak:QueryIndexDefinition
 async=async
 compatVersion={Long}2
 type=lucene
 indexRules jcr:primaryType=nt:unstructured
 nt:base jcr:primaryType=nt:unstructured
 properties jcr:primaryType=nt:unstructured
 description
 jcr:primaryType=nt:unstructured
 analyzed={Boolean}true
 name=description
 propertyIndex={Boolean}true
 useInSuggest={Boolean}true/
 /properties
 /nt:base
 /indexRules
 /lucene-suggest
 {code}
 works, but if we change nodetype to {{nt:unstructured}} like:
 {code:xml}
 lucene-suggest
 jcr:primaryType=oak:QueryIndexDefinition
 async=async
 compatVersion={Long}2
 type=lucene
 indexRules jcr:primaryType=nt:unstructured
 nt:unstructured jcr:primaryType=nt:unstructured
 properties jcr:primaryType=nt:unstructured
 description
 jcr:primaryType=nt:unstructured
 analyzed={Boolean}true
 name=description
 propertyIndex={Boolean}true
 useInSuggest={Boolean}true/
 /properties
 /nt:base
 /indexRules
 /lucene-suggest
 {code}
 , it won't work.
 The issue is that suggestor implementation essentially is passing a pseudo 
 row with path=/.:
 {code:title=LucenePropertyIndex.java}
 private boolean loadDocs() {
 ...
 queue.add(new LuceneResultRow(suggestedWords));
 ...
 {code}
 and
 {code:title=LucenePropertyIndex.java}
 LuceneResultRow(IterableString suggestWords) {
 this.path = /;
 this.score = 1.0d;
 this.suggestWords = suggestWords;
 }
 {code}
 Due to path being set to /, {{SelectorImpl}} later filters out the result 
 as {{rep:root}} (primary type of /) isn't a {{nt:unstructured}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OAK-3156) Lucene suggestions index definition can't be restricted to a specific type of node

2015-07-29 Thread Chetan Mehrotra (JIRA)

[ 
https://issues.apache.org/jira/browse/OAK-3156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14645712#comment-14645712
 ] 

Chetan Mehrotra commented on OAK-3156:
--

[~tmueller] [~teofili] Looks like we would need to have way to convey to QE 
that results rows for such queries are pseudo rows and QE should not apply 
standard checks for it. Further its very much possible that user might not have 
a read permission for a node represent by '/' and in such a case also suggestor 
would not work.

Any thoughts on how to handle such query results?

 Lucene suggestions index definition can't be restricted to a specific type of 
 node
 --

 Key: OAK-3156
 URL: https://issues.apache.org/jira/browse/OAK-3156
 Project: Jackrabbit Oak
  Issue Type: Bug
  Components: lucene
Reporter: Vikas Saurabh
 Attachments: LuceneIndexSuggestionTest.java


 While performing a suggestor query like 
 {code}
 SELECT [rep:suggest()] as suggestion  FROM [nt:unstructured] WHERE 
 suggest('foo')
 {code}
 Suggestor does not provide any result. In current implementation, 
 [suggestions|http://jackrabbit.apache.org/oak/docs/query/lucene.html#Suggestions]
  in Oak work only for index definitions for {{nt:base}} nodetype.
 So, an index definition like:
 {code:xml}
 lucene-suggest
 jcr:primaryType=oak:QueryIndexDefinition
 async=async
 compatVersion={Long}2
 type=lucene
 indexRules jcr:primaryType=nt:unstructured
 nt:base jcr:primaryType=nt:unstructured
 properties jcr:primaryType=nt:unstructured
 description
 jcr:primaryType=nt:unstructured
 analyzed={Boolean}true
 name=description
 propertyIndex={Boolean}true
 useInSuggest={Boolean}true/
 /properties
 /nt:base
 /indexRules
 /lucene-suggest
 {code}
 works, but if we change nodetype to {{nt:unstructured}} like:
 {code:xml}
 lucene-suggest
 jcr:primaryType=oak:QueryIndexDefinition
 async=async
 compatVersion={Long}2
 type=lucene
 indexRules jcr:primaryType=nt:unstructured
 nt:unstructured jcr:primaryType=nt:unstructured
 properties jcr:primaryType=nt:unstructured
 description
 jcr:primaryType=nt:unstructured
 analyzed={Boolean}true
 name=description
 propertyIndex={Boolean}true
 useInSuggest={Boolean}true/
 /properties
 /nt:base
 /indexRules
 /lucene-suggest
 {code}
 , it won't work.
 The issue is that suggestor implementation essentially is passing a pseudo 
 row with path=/.:
 {code:title=LucenePropertyIndex.java}
 private boolean loadDocs() {
 ...
 queue.add(new LuceneResultRow(suggestedWords));
 ...
 {code}
 and
 {code:title=LucenePropertyIndex.java}
 LuceneResultRow(IterableString suggestWords) {
 this.path = /;
 this.score = 1.0d;
 this.suggestWords = suggestWords;
 }
 {code}
 Due to path being set to /, {{SelectorImpl}} later filters out the result 
 as {{rep:root}} (primary type of /) isn't a {{nt:unstructured}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)