Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

manual index bug #6457

Closed
4 tasks
publicocean0 opened this issue Jul 23, 2016 · 20 comments
Closed
4 tasks

manual index bug #6457

publicocean0 opened this issue Jul 23, 2016 · 20 comments

Comments

@publicocean0
Copy link

publicocean0 commented Jul 23, 2016

OrientDB Version, operating system, or hardware.

  • v2.0 SNAPSHOT[ ] - .18[ ] .17[ ] .16[ ] .15[ ] .14[ ] .13[ ] .12[ ] .11[ ] .10[ ] .9[ ] .8[ ] .7[ ] .6[ ] .5[ ] .4[ ] .3[ ] .2[ ] .1[ ] .0[ ]
  • v2.1 SNAPSHOT[ ] - .16[ ] .15[ ] .14[ ] .13[ ] .12[ ] .11[ ] .10[ ] .9[ ] .8[ ] .7[ ] .6[ ] .5[ ] .4[ ] .3[ ] .2[ ] .1[ ] .0[ ]
  • v2.2 SNAPSHOT[ x ] - .rc1[ ] .beta2[ ] .beta1[ ]

Operating System

orientdb> SELECT FROM INDEX:Manual WHERE key LUCENE "Enrico"

if want search for prop 1 and not for prop2 how to do?

select from index:Manual34 where [prop1, prop2] LUCENE "(prop1:foo AND prop2:bar)"

Error: com.orientechnologies.orient.core.exception.OCommandExecutionException: 'Key' field is required for queries against indexes

it seams there is no way for finding a specific property of schema

@lvca lvca added the question label Jul 23, 2016
@publicocean0 publicocean0 changed the title manual index bug or question manual index bug Jul 24, 2016
@wolf4ood
Copy link
Member

did you try?
select from index:Manual34 where key LUCENE "(prop1:foo AND prop2:bar)"

@wolf4ood
Copy link
Member

wolf4ood commented Jul 24, 2016

@publicocean0

sorry was't documented on multiple fields in manual index. Since it's manual and there aren't properties the engine generates the name k1,k2,k3..kN

select from index:Manual34 where key LUCENE "(k0:foo AND k1:bar)"

See
LuceneManualIndex test

@wolf4ood
Copy link
Member

@publicocean0 the exception that you get is at parsing time because the key is mandatory in index: syntax

@publicocean0
Copy link
Author

CREATE INDEX Manual11 FULLTEXT ENGINE LUCENE long , long ,long ,long
insert into index:Manual11 (key, rid) values([1,2,3,4],#30:3)

Inserted record '{rid:#30:3,key:[4]}' in 0,455000 sec(s).
select from index:Manual11 where key LUCENE "(k0:1)"

Error: com.orientechnologies.orient.core.exception.OCommandExecutionException: Error on execution of command: sql.select from index:Manual11 where key LUCENE "(k0:1)"

Error: java.lang.NumberFormatException: For input string: "(k0:1)"

@publicocean0
Copy link
Author

publicocean0 commented Jul 24, 2016

CREATE INDEX Manual13 FULLTEXT ENGINE LUCENE string , string , string , string

Creating index...
Created index successfully with 0 entries in 0,337000 sec(s).

Index created successfully
insert into index:Manual13 (key, rid) values(['a','b','c','d'],#30:3)

Inserted record '{rid:#30:3,key:[4]}' in 0,327000 sec(s).

select from index:Manual13 where key LUCENE "k0:'a'"

0 item(s) found. Query executed in 0.227 sec(s).

OCompositeKey consider string entirely

@wolf4ood
Copy link
Member

wolf4ood commented Jul 24, 2016

@publicocean0

the first one is a type problem. With lucene we support strings or list of strings

the second one you are not taking in account the Analyzer.

a is a stop word that is removed in indexing phase.

insert into index:Manual13 (key, rid) values(['Test','b','c','d'],#30:3)
select from index:Manual13 where key LUCENE "(k0:Test)"

@wolf4ood
Copy link
Member

@publicocean0
is it working ?

@publicocean0
Copy link
Author

publicocean0 commented Jul 24, 2016

select from index:Manual13 where key LUCENE "k0:Test"

Error: java.lang.NoClassDefFoundError: com/orientechnologies/orient/core/serialization/OBase64Utils

Error: java.lang.ClassNotFoundException: com.orientechnologies.orient.core.serialization.OBase64Utils

@publicocean0
Copy link
Author

publicocean0 commented Jul 24, 2016

reading in the log
Error: java.lang.NumberFormatException: For input string: "(k0:1)"

so it is trying to parsing as number "(k0:1)"

@wolf4ood
Copy link
Member

@publicocean0

tested without problem in 2.2.5 plocal and remote with the index created

in this way

CREATE INDEX Manual13 FULLTEXT ENGINE LUCENE string , string , string , string

@publicocean0
Copy link
Author

i have 2.2.6.

i will try to recompile....

@wolf4ood
Copy link
Member

Btw you get this

`Error: java.lang.NumberFormatException: For input string: "(k0:1)"```

from the query engine. This is an integration problem.
Because the fields are long and the param is a string.

@publicocean0
Copy link
Author

publicocean0 commented Jul 24, 2016

same error after recompilation boh

select from index:Manual13 where key LUCENE "k0:Test"

Error: java.lang.NoClassDefFoundError: com/orientechnologies/orient/core/serialization/OBase64Utils

Error: java.lang.ClassNotFoundException: com.orientechnologies.orient.core.serialization.OBase64Utils

@publicocean0
Copy link
Author

publicocean0 commented Jul 25, 2016

ok now it works in 2.6 ... a problem with console. restarting console it works.

It remains the problems with key for data type not string.

@wolf4ood
Copy link
Member

@publicocean0
that is the sql engine check with types. Let me check if can do something about it

@publicocean0
Copy link
Author

publicocean0 commented Jul 26, 2016

ok it is not urgent , i passed to another task in the while, fortunately i have a pile of tasks to do :)
In the while if you have a idea how to make a index for chunks (startoffset,endoffset,index) from a remote client saving the chunks inside a transaction (seekable file to read) i will go to london to make compliments to you :).

@publicocean0
Copy link
Author

A similar problem is also in automatic lucene. I have a property long but when i make query no field is found

@wolf4ood
Copy link
Member

hi @publicocean0

i guess, the code is the same.
We did integrate and test the text indexing of lucene.
The number handling was left out. We should extend the query parser of lucene in order to support numeric ranges.

@wolf4ood
Copy link
Member

@publicocean0
For numbers you should use native indexing.

@publicocean0
Copy link
Author

publicocean0 commented Jul 30, 2016

Impossible , my query in index needs to create a expression with indexed fields. It is a tipical case in which need lucene. In addition in future i need to search inside properties (embedded map defined by user on the fly). Unfortunatelly, indexes used as projections on single fixed fields are just a sub case of all possible ones.

@laa laa closed this as completed Aug 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants