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

Lucene not working correctly with "Cluster:xx" query #6594

Closed
2 of 5 tasks
a-marcel opened this issue Aug 22, 2016 · 17 comments
Closed
2 of 5 tasks

Lucene not working correctly with "Cluster:xx" query #6594

a-marcel opened this issue Aug 22, 2016 · 17 comments
Assignees
Milestone

Comments

@a-marcel
Copy link

a-marcel commented Aug 22, 2016

OrientDB Version, operating system, or hardware.

  • v2.2.7[x]

Operating System

  • Linux
  • MacOSX
  • Windows
  • Other Unix
  • Other, name?

Expected behavior and actual behavior

i've created an lucene index with following java:

final ODocument metadata = new ODocument();
    metadata.field("default", "org.apache.lucene.analysis.de.GermanAnalyzer");
regionType.createIndex(CLASS_NAME + ".name_de", "FULLTEXT", null, metadata, "LUCENE",
        new String[] { "name_de" });

i insert this test data:

[{"name_de": "nord"},{"name_de":"nördlich"}]

Steps to reproduce the problem

My select query:

select * from Region where [name_de] LUCENE 'nor*'

returns the two rows and this is what i expect.

For the future, i'd like to query two or more classes with one query. i figure out, this is possible via "cluster:". my query is now:

select * from cluster:Region where [name_de] LUCENE 'nor*'

and this returns just one row -> "nord".

Is that a valid behaviour ?

Thanks
Marcel Alburg

@robfrank robfrank self-assigned this Aug 22, 2016
@wolf4ood
Copy link
Member

@marcelalburg

What do you mean by

For the future, i'd like to query two or more classes with one query.

@a-marcel
Copy link
Author

Hey, sorry maybe i use the wrong expression to describe that.

in the future, i'll use something like this:

select * from cluster:[Region,Abc,Cde] where [name_de] LUCENE 'nor*'

Thanks
Marcel

@wolf4ood
Copy link
Member

@marcelalburg

I think it will not work.

Indexes works at class level not cluster level.

@a-marcel
Copy link
Author

a-marcel commented Aug 23, 2016

Mhh ok, then i will use a manual index for this.

Maybe you could answer me one more question. If i add multiple times the same value with the same vertex (#nn:n) to a manual index. is there any problem about that ?

Thanks for your answer
Marcel

@wolf4ood
Copy link
Member

@marcelalburg

no problem. You will get multiple times the same vertex in the results set.

Can you explain a little bit you use case maybe i can help more

Thanks

@StarpTech
Copy link

StarpTech commented Aug 23, 2016

Hi @maggiolo00 indexes arent supported for Clusters? This would mean that the concept of clustering and distribution is uncomplete?!

When I understand correctly then clustering is a mechanism of grouping but the set are still classes so mechanism of look up is missing.

@StarpTech
Copy link

StarpTech commented Aug 23, 2016

The same issue is that edges cannot be deleted by a cluster selection.

#6590

@maggiolo00 whats the roadmap for the clustering strategy ?

@a-marcel
Copy link
Author

a-marcel commented Aug 23, 2016

Hello,

i try to explain my usecase:

I've following classes:

Continent
Country
Region
Area
aso.

Every Class has different properties but min. a "name" property.

and i like to create an AutoComplete/Suggest Lucene index on this field and all classes (this works). But i need to query them now.

I hope this explained it a little bit.

Thanks
Marcel

Code Example for one "class":

OrientVertexType areaType = noTxGraph.createVertexType(CLASS_NAME);
    areaType.createProperty(KEY_NAME, OType.STRING);
    areaType.createProperty("name", OType.STRING);
    areaType.createProperty("latitude", OType.DOUBLE);
    areaType.createProperty("longitude", OType.DOUBLE);
    areaType.createProperty("route_count", OType.INTEGER);
    areaType.createProperty(PROPERTY_SUGGEST_NAME_DE, OType.STRING);
    areaType.createProperty(PROPERTY_SUGGEST_TAGS_DE, OType.STRING);

    final ODocument metadata = new ODocument();
    metadata.field("default", "org.apache.lucene.analysis.de.GermanAnalyzer");

    areaType.createIndex(CLASS_NAME + ".suggest_de", "FULLTEXT", null, metadata, "LUCENE",
        new String[] { PROPERTY_SUGGEST_NAME_DE, PROPERTY_SUGGEST_TAGS_DE });

@a-marcel
Copy link
Author

a-marcel commented Sep 3, 2016

Hello, i found an other solution for my problem.

i create a base Class "Searchable" wich one contains all fields for searching. On this class, i create my fulltext lucene index.

all other classes (see above) extends this "Searchable" class.

Now, it's possible to query just the "Searchable" class with the LUCENE Query.

Thanks
Marcel

@a-marcel a-marcel closed this as completed Sep 3, 2016
@StarpTech
Copy link

StarpTech commented Sep 3, 2016

Hi @marcelalburg your solution is no answer to your issue. Its still an issue. Please reopen or I will open a new one because it will address me soon. Thanks.

@a-marcel a-marcel reopened this Sep 3, 2016
@StarpTech
Copy link

@maggiolo00 can you answer my questions? Thanks.

@robfrank robfrank added this to the 2.2.x (next hotfix) milestone Jan 30, 2017
@robfrank
Copy link
Contributor

Hi, on the next 2.2.16 version Lucene indexes will contain additional metadata fields _CLUSTER and _CLASS. So a query could be partitioned by cluster:

SELECT FROM Person WHERE name LUCENE '+_CLUSTER:26  OTHER QUERY ' "

@StarpTech
Copy link

StarpTech commented Jan 31, 2017

You closed the issue before it released. Awesome!

@robfrank
Copy link
Contributor

What do you mean?

@StarpTech
Copy link

StarpTech commented Jan 31, 2017

@robfrank the current release is 2.2.15 you closed the issue before 2.2.16 was released.

@robfrank robfrank reopened this Jan 31, 2017
@robfrank
Copy link
Contributor

Can you test with a snapshot? I mean 2.2.16-SNAPSHOT.

@robfrank
Copy link
Contributor

robfrank commented Feb 6, 2017

this feature is included in 2.2.16. I close it, feel free to open a new issue relative to the feature as it is implemented.

@robfrank robfrank closed this as completed Feb 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

7 participants