Fulltext index in lowercase

113 views
Skip to first unread message

Riccardo Tasso

unread,
Apr 11, 2014, 5:40:31 AM4/11/14
to orient-...@googlegroups.com
Hi, I'm experimenting the fulltext index which is an interesting function for OrientDB.

The containsText operator works as expected, if a fulltext index is created, but it's case sensitive.

Is there a way to create a fulltext index which is case insensitive?

Thanks,
   Riccardo

Luca Garulli

unread,
Apr 11, 2014, 6:32:26 AM4/11/14
to orient-database
Hi Riccardo,
Have you tried to set the collate "CI" against the indexed field?

Lvc@


PS: why you are not at Codemotion event in Rome today?! :-)





--

---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Riccardo Tasso

unread,
Apr 11, 2014, 6:59:21 AM4/11/14
to orient-...@googlegroups.com

2014-04-11 12:32 GMT+02:00 Luca Garulli <l.ga...@gmail.com>:
Have you tried to set the collate "CI" against the indexed field?

Hi Luca, thanks first of all.

Do you mean something like: create index myidx ON Agent (label COLLATE CI) FULLTEXT  ?
It gives me the following exception:
Error: com.orientechnologies.orient.core.sql.OCommandSQLParsingException: Error on parsing command at position #27: Illegal field name format, should be '<property> [by key|value]' but was 'label COLLATE CI'

Riccardo

Andrey Lomakin

unread,
Apr 11, 2014, 7:52:50 AM4/11/14
to orient-database
Hi,
I have fixed it yesterday.
Could you try ?


--

---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Best regards,
Andrey Lomakin.

Orient Technologies
the Company behind OrientDB

Riccardo Tasso

unread,
Apr 11, 2014, 8:38:25 AM4/11/14
to orient-...@googlegroups.com
I'm sorry, I can't try at this moment, when the 1.7.0 version is expected?

Riccardo

Andrey Lomakin

unread,
Apr 11, 2014, 8:55:01 AM4/11/14
to orient-database
According to our estimations we need 4 weeks.

Andrey Lomakin

unread,
Apr 11, 2014, 8:55:24 AM4/11/14
to orient-database
If current release scope will not be changed of course.

Riccardo Tasso

unread,
Apr 11, 2014, 9:51:32 AM4/11/14
to orient-...@googlegroups.com
Anyway the syntax is correct?
Please add this part to the index documentation, I didn't find anything!

Riccardo

Andrey Lomakin

unread,
Apr 11, 2014, 10:32:50 AM4/11/14
to orient-database
Yes,
This syntax is correct.

Justin Harris

unread,
Apr 11, 2014, 2:43:13 PM4/11/14
to orient-...@googlegroups.com
In the meantime, I found that:
create index myidx ON Agent (label) FULLTEXT

works if the label property has already been set to use CI collating, I did it in Java by doing something like this:
OrientGraphNoTx _g = new OrientGraphFactory("remote:localhost/graph").getNoTx();
OrientVertexType vertexType = _g.createVertexType(
               
"Agent",
               
OrientVertexType.CLASS_NAME);
        
vertexType.createProperty("label", OType.STRING).setCollate("CI");

You can query it like so:
SELECT FROM index:myidx where key = ?


Hung Tran

unread,
Apr 14, 2014, 1:48:11 AM4/14/14
to orient-...@googlegroups.com
Hi,

I cannot find any method with name setCollate in the source code at version 1.6.0, any help?

My Best,
Hung Tran

Riccardo Tasso

unread,
Apr 14, 2014, 3:15:38 AM4/14/14
to orient-...@googlegroups.com

2014-04-11 20:43 GMT+02:00 Justin Harris <justin...@gmail.com>:
works if the label property has already been set to use CI collating, I did it in Java by doing something like this

Thanks, can I do it with a console command?

Cheers,
   Riccardo

Riccardo Tasso

unread,
Apr 14, 2014, 3:23:29 AM4/14/14
to orient-...@googlegroups.com

2014-04-14 9:15 GMT+02:00 Riccardo Tasso <riccard...@gmail.com>:
Thanks, can I do it with a console command?

Yes, it is done by:

ALTER PROPERTY MyClass.my_property COLLATE ci

Thanks for the suggesion, it seems to work.

Riccardo

Riccardo Tasso

unread,
Apr 14, 2014, 4:19:56 AM4/14/14
to orient-...@googlegroups.com
Hi, I can't decide if I found a bug. When I change the collate for a field, also the fields with the same name of the super-classes change collate. I understood that for a hierarchy of classes the field is the same, but this behaviour seems to me a bit unexpected.

In attachment you'll find the test-case.

Cheers,
   Riccardo
HierarchicalCollateOrientTest.java

Justin Harris

unread,
Apr 14, 2014, 5:16:56 AM4/14/14
to orient-...@googlegroups.com

Hey Hung,

I'm using the latest as of now, 1.7-rc2.

Justin Harris | via Android

You received this message because you are subscribed to a topic in the Google Groups "OrientDB" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/orient-database/ZgGgeaRSMK8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to orient-databa...@googlegroups.com.

Luca Garulli

unread,
Apr 14, 2014, 8:00:22 AM4/14/14
to orient-database
Hi Riccardo,
good question. In OO the underlying property should overwrite the base one, but this could drives to problems and unexpected behaviors. But if this is what you need the collate shouldn't be propagated to the sub-field because it should be managed as an overriding of the base field.

May you open an new issue attaching this test case?

Lvc@



Riccardo Tasso

unread,
Apr 14, 2014, 8:34:04 AM4/14/14
to orient-...@googlegroups.com
This is not a problem for my use case, anyway this is the issue: https://github.com/orientechnologies/orientdb/issues/2225

Riccardo
Reply all
Reply to author
Forward
0 new messages