Case insensitive fulltext search

684 views
Skip to first unread message

Pierre De Wilde

unread,
Sep 24, 2011, 8:03:55 AM9/24/11
to gremli...@googlegroups.com
Hi,

Does someone know a way to do a case insensitive fulltext search using Neo4j Lucene?

gremlin> g.idx(T.v)[[name:'%query%hey*']].name
gremlin> 
gremlin> g.idx(T.v)[[name:'%query%HEY*']].name
==>HEY BO DIDDLEY
==>HEY JUDE
==>HEY POCKY WAY
==>HEY LITTLE ONE

Thanks,
Pierre

Peter Neubauer

unread,
Sep 24, 2011, 9:09:34 AM9/24/11
to gremli...@googlegroups.com
Pierre,
I think this is Lucene magic required, see
http://marc.info/?l=lucene-user&m=122724906210436. You can drop down
to the Neo4j API and do this, see the example for Lucene custom
sorting in a Gremlin script,
http://docs.neo4j.org/chunked/snapshot/gremlin-plugin.html#rest-api-send-an-arbitrary-groovy-script---lucene-sorting

Does that help?

Cheers,

/peter neubauer

GTalk:      neubauer.peter
Skype       peter.neubauer
Phone       +46 704 106975
LinkedIn   http://www.linkedin.com/in/neubauer
Twitter      http://twitter.com/peterneubauer

http://www.neo4j.org               - Your high performance graph database.
http://startupbootcamp.org/    - Öresund - Innovation happens HERE.
http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.

Pierre De Wilde

unread,
Sep 24, 2011, 10:12:48 AM9/24/11
to gremli...@googlegroups.com
Thanks, Peter.

Neo4j automatic index created by Blueprints is type=exact, which is case-sensitive. 
I would like to use type=fulltext, which is case-insensitive (to_lower_case=true by default).
But I don't know how, I mean from a Gremlin perspective.

Thanks,
Pierre

James Thornton

unread,
Sep 28, 2011, 5:14:59 AM9/28/11
to gremli...@googlegroups.com
> Neo4j automatic index created by Blueprints is type=exact, which is case-sensitive. 
> I would like to use type=fulltext, which is case-insensitive (to_lower_case=true by default).
> But I don't know how, I mean from a Gremlin perspective.

Hi Pierre -

To be able to do this from the TinkerPop stack, I think Blueprints/Rexster need the ability to support more than one type of index for each DB. 

Right now only the default index for each DB is supported. Here is a support ticket regarding this...


- James

James Thornton

unread,
Sep 28, 2011, 8:35:22 AM9/28/11
to gremli...@googlegroups.com
> Neo4j automatic index created by Blueprints is type=exact, which is case-sensitive. 
> I would like to use type=fulltext, which is case-insensitive (to_lower_case=true by default).
> But I don't know how, I mean from a Gremlin perspective.

Pierre -

Until full-text search is supported, a workaround is to use an external full-text index such as Solr, ElasticSearch, or IndexTank (http://indextank.com/).

For example, you could do the full-text query using Solr and have it return a list of element IDs. Then if you want to use Gremlin for ranking, you could pass in the list of element IDs to Gremlin as the starting point of the query, and do a "local rank" type algorithm (http://markorodriguez.com/2011/03/30/global-vs-local-graph-ranking/).

To make this work, a few weeks ago Marko updated Gremlin so you can pass in multiple element IDs like this:

  g.v(1,2,3,4,5,6,7,8)

See https://groups.google.com/d/topic/gremlin-users/JjOopbFDHMw/discussion


- James

Pierre De Wilde

unread,
Sep 28, 2011, 11:30:34 AM9/28/11
to gremli...@googlegroups.com
Thanks, James. 

My concern was to use Neo4j built-in fulltext search capability within Blueprints/Gremlin...

Pierre

Marko Rodriguez

unread,
Sep 28, 2011, 12:06:10 PM9/28/11
to gremli...@googlegroups.com
We need to do this. Its been a dangling issue for a few release cycles now. Perhaps we can do it for 1.1. :/

Marko.

Marko Rodriguez

unread,
Jul 8, 2012, 12:34:07 PM7/8/12
to gremli...@googlegroups.com
Hi,

Long ago. Please see the bottom of:


HTH,
Marko.


On Jul 8, 2012, at 10:23 AM, edude03 wrote:

Did this issue ever get solved? I'm currently trying to do the same thing, however from searching the forum I can't seem to find anything about doing so.

edude03

unread,
Jul 8, 2012, 12:35:45 PM7/8/12
to gremli...@googlegroups.com
Awesome, Thanks!
Reply all
Reply to author
Forward
0 new messages