Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
03-16-2021 04:36 AM
Hi,
I have a use case where I'm doing a full text search across several types of entities, and I'd like the results to promote one of those entities (something like ^2 from Apache Lucene).
Is such a thing possible ? I didn't find anything in the docs.
Thanks in advance,
Olivier
03-16-2021 05:06 AM
Hello Layvier,
Could you please explain it with an example or elaborate little more? how you are doing the full text search and how you want to promote it.
Thanks,
Rishabh
03-16-2021 05:21 AM
So basically I'm creating a fulltext index, as described here: Fulltext search in Neo4j - Knowledge Base
Here's the created index:
CALL db.index.fulltext.createNodeIndex("titlesAndDescriptions",["Movie", "Book"],["title", "description", "review"])
I am then querying it like this:
CALL db.index.fulltext.queryNodes("titlesAndDescriptions", "title:matrix^3 description:matrix") YIELD node, score
RETURN node.title, node.review, score
Here I'm boosting the score using ^ so that the score get higher if a match happens on the title field.
What I would like is to boost the score in the same way if the node is of label Movie, so that my search prioritises movies over books.
Hope it's clearer 🙂
03-16-2021 08:27 AM
@Layvier
Did you tried using labels like below. Not 100% sure about it but mostly it should work.
CALL db.index.fulltext.queryNodes("titlesAndDescriptionsLabel","label:Movie^3 label contain 'Movie'") YIELD node, score
RETURN node.title, node.review, score
03-17-2021 01:30 PM
I couldn't make it work 😕 .
I don't recognise the syntax of the query you provided, can you forward me some documentation regarding that ? I only found this: Apache Lucene - Query Parser Syntax
08-24-2021 11:17 PM
@Layvier, we have similar kind of requirement, we are multiple nodes on the search. We tried using WITH clause and order by clause to achieve this but still it seems more refinement.
11-11-2021 02:24 AM
I'm also trying to boost based on node label.
@prishabh35 I can't get this approach to work either. I'm also interested in any documentation regarding this.
@deepika could you elaborate on what you attempted using the WITH clause?
Layvier did you make any progress in the meantime?
Thank you all in advance!
11-11-2021 03:01 AM
We have created the custom logic on the top of the lucene search to match our requirement.
All the sessions of the conference are now available online