OrientDB: how to search over specified field in manual lucene index?

I'm using OrientDB 2.1.8 Community and built-in Lucene index. How I can define which field I want to use during the search in manual index? I.e. work with manual indexes in a manner like described on Working with Multiple Fields page in the documentation?

Below is short example to show what I'm trying to do.

CREATE VERTEX CONTENT {"name": "squirrel"}
  // rid = #9:2
CREATE VERTEX CONTENT {"name": "scrat", "description": "Scrat was an acorn-obsessed saber-toothed squirrel"}
  // rid = #9:3

CREATE INDEX manual FULLTEXT ENGINE LUCENE STRING,STRING
INSERT INTO INDEX:manual (key,rid) VALUES ('squirrel', #9:2)
INSERT INTO INDEX:manual (key,rid) VALUES (['scrat', 'scrat was an acorn-obsessed saber-toothed squirrel'], #9:3)

Now query SELECT rid FROM INDEX:manual WHERE key LUCENE 'squirrel' will return both #9:2 and #9:3.

How I should change the type of the key and/or INSERT INTO INDEX commands to be able to define which field I want to use? For example, query like SELECT rid FROM INDEX:manual WHERE key LUCENE 'name:squirrel' should return only #9:2, but not #9:3.

Any ideas?

Answers


I have tried with create index manual FULLTEXT ENGINE LUCENE STRING,STRING METADATA {"analyzer":"org.apache.lucene.analysis.core.KeywordAnalyzer"} and it works

CREATE VERTEX CONTENT {"name": "squirrel"}

CREATE VERTEX CONTENT {"name": "scrat", "description": "Scrat was an acorn-obsessed saber-toothed squirrel"}

create index manual FULLTEXT ENGINE LUCENE STRING,STRING METADATA {"analyzer":"org.apache.lucene.analysis.core.KeywordAnalyzer"} 

INSERT INTO INDEX:manual (key,rid) VALUES ('squirrel', #9:0)

INSERT INTO INDEX:manual (key,rid) VALUES (['scrat', 'scrat was an acorn-obsessed saber-toothed squirrel'], #9:1)


Need Your Help

How do I access deployment history in Azure Web Apps?

git azure continuous-integration azure-web-sites continuous-deployment

I set up multiple deployment slots for a web app. We have continuous deployment configured on the staging slot, so each Git commit on a specific branch triggers a deployment to my staging slot. Once

Java - synchronized method/ block

java multithreading static synchronized

If I am using synchronized, then does the object which is being synchronized have to be static?