You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-dev@jackrabbit.apache.org by "jorgeeflorez ." <jo...@gmail.com> on 2019/11/29 18:06:40 UTC

Use Lucene Index for all property types?

Hi,
I apologize in advance if this email is too long to read.

I am trying to create one Lucene index that includes all user defined
properties and excludes some other "not visible" properties.

Should I include in my Lucene index, properties of type LONG, DOUBLE, DATE?
would it speed up numbers or dates comparison?
How values of these types are sent to the analyzer, as the string that
appears in the Mongo document (for example)?

I am having this problem:

I have a node with the following property (the property type is DOUBLE):
Node : /repo2/Folder3
Node type: FolderL1
Property L1_double  Value: 10.0147

When I execute this query :
SELECT * FROM [FolderL1] as n WHERE (n.[L1_double] = 10.0147)
having no lucene index I get the node. *Everything is ok so far*. This is
the query stuff:
Parsing JCR-SQL2 statement: SELECT * FROM [FolderL1] as n WHERE
(n.[L1_double] = 10.0147)
- cost using filter Filter(query=SELECT * FROM [FolderL1] as n WHERE
(n.[L1_double] = 10.0147), path=*, property=[L1_double=[10.0147]])
- cost for reference is Infinity
- cost for property is Infinity
- cost for nodeType is 24.0
- cost for lucene-property is Infinity
- cost for aggregate lucene is Infinity
- cost for traverse is 2148.0
- query plan [FolderL1] as [n] /* nodeType Filter(query=SELECT * FROM
[FolderL1] as n WHERE (n.[L1_double] = 10.0147), path=*,
property=[L1_double=[10.0147]]) where [n].[L1_double] = cast('10.0147' as
decimal) */

but when I define this index named *indice1* with the following:
  - compatVersion = 2
  - async = "async"
  - jcr:primaryType = oak:QueryIndexDefinition
  - type = "lucene"
  + indexRules
   + FolderL1
    + properties
     + L1_double
      - name = "L1_double"
      - propertyIndex = true

and execute the query, I don't get the node as result. This is the query
stuff:
- Parsing JCR-SQL2 statement: SELECT * FROM [FolderL1] as n WHERE
(n.[L1_double] = 10.0147)
- cost using filter Filter(query=SELECT * FROM [FolderL1] as n WHERE
(n.[L1_double] = 10.0147), path=*, property=[L1_double=[10.0147]])
- cost for reference is Infinity
- cost for property is Infinity
- cost for nodeType is 24.0
- cost for [/oak:index/indice1] of type (lucene-property) with plan
[lucene:indice1(/oak:index/indice1) L1_double:10.0147] is 2.00
- cost for lucene-property is Infinity
- cost for traverse is 2148.0
- count: 1 query: SELECT * FROM [FolderL1] as n WHERE (n.[L1_double] =
10.0147)
- query execute SELECT * FROM [FolderL1] as n WHERE (n.[L1_double] =
10.0147)
- query plan [FolderL1] as [n] /* lucene:indice1(/oak:index/indice1)
L1_double:10.0147 where [n].[L1_double] = cast('10.0147' as decimal) */

Maybe I am missing something...
I hope someone can help me. Thanks.

Jorge