Sorting by relevance is possible via
http://components.neo4j.org/neo4j-index/apidocs/org/neo4j/index/lucene/LuceneIndexService.html#getNodes(java.lang.String,%20java.lang.Object,%20org.apache.lucene.search.Sort).
Exposing this sorting thingie would require you to add that in the rest code
as well (as you probably could guess). But the IndexService doesn't support
querying for more than one property at a time.

However, there's a new indexing framework in the making over at
https://svn.neo4j.org/laboratory/components/lucene-index/ which allows you
to do these types of queries. This new framework will probably make its way
into trunk rather soon and eventually replace the indexing found in
neo4j-index component today.

So the answer is no if you use neo4j-index component (which REST does). But
it's yes if REST were to use the new framework instead. I'll commit the
additions regarding sorting and all that soon (I'm laborating with it
a.t.m.). You could f.ex. ask a query like:

   for ( Node node : myTitleIndex.query(
       new QueryContext( "+title:foo* description:bar" ).sort(
Sort.RELEVANCE ) ) {}

2010/7/16 Andrew Mutz <andrew.m...@appfolio.com>

> Hi all,
>
> I've been evaluating using Neo4J for a project at my company and have been
> consistently impressed with it's capabilities.  There is one thing I need
> to
> do, however, that I'm not sure is possible.
>
> I'm using the Neo4J REST server.  I've been using lucene full text
> indexing/searching on my node attributes with great success.
>
> What I want to be able to do is to adjust the relevancy of the results
> returned by lucene based on attributes *other* than the one I'm searching
> on.
>
> Example:  Nodes have attributes title and description.  I want to search
> for
> all nodes, say, whose title matches "foo*", but have whether or not
> description matches "bar*" affect the order of the search results.
>
> Is this possible?  I'm very comfortable getting my hands dirty in the
> source, so if this is going to require some hacking, just point me in the
> right direction.  I've been extensively modifying the REST server to fit my
> needs, so ideally my changes would be in that part of the code base.  But
> I'm willing to dig deeper if necessary.
>
> Thanks much,
> Andrew.
>
>
> --
> Andrew Mutz
> Senior Software Engineer
> AppFolio, Inc.
>
> 55 Castilian Dr. | Goleta, CA | 93117
> Phone: 805.617.2167 | Fax: 805.968.0646
> andrew.m...@appfolio.com
> www.appfolio.com
>
> -------------------------------------------------------------------------------------
> "Web-Based Property Management Software Made Easy."
> _______________________________________________
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>



-- 
Mattias Persson, [matt...@neotechnology.com]
Hacker, Neo Technology
www.neotechnology.com
_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to