Combining Neo4j and Elasticsearch -
I am using Neo4j as my primary database, this graph is a good piece of database that I am getting between nodes I give great control over the connection. However, this is a great lack of search for full text (search facility on the website). And so, I'm thinking of using elastic search to create a search feature on my application. But there are some issues while doing this. Let's say we're searching for user terms. Neo4j post can have the following models.
(post) & lt; - [: AUTHOR] - (user) (post) - [: LIKED_BY] - & gt; (Other users) (good) about Neo4j (post) when assuming posts in a user profile - [: COMMENTED_BY] - & gt; (Other users) (post) - [: HAS_PHOTO] - & gt; (Photo) ) is that you can hold it at once (profile pictures and user details when you are doing it and if you already liked the post). This is a lot of detail in a query (cyber command). Now if we want to give details of the same level for the elastic sketch output, then at this time I can think of the following:
-
Store everything in Neo4j and Elastic cautions when someone If the text is searched for a list of results, it removes itself from elastic search but there are still problems if the user has already liked the post (this requires re-inquiries for each post. Ti? It does not look very good)
-
Store id Elasticsearch. After making search results popular, get information from each post from neo4j database from this post ID and display results. (10 results -> 10 different calls are again very inefficient)
-
Get a list of IDs that provide an Alicash Stitch and make 1 call neo4j and get results (no How to do or display problems). A cipher reference can be helpful.
Any of these solutions? They are a little inefficient.
This is a bit of opinion based question because it is not a "right" answer, therefore crash Prepare a SO no-fun hammer to happen ... but I'm thinking that the One-Two (Elastic Stretcher to Neo) Punch is the best way to handle this: Index properties are flexible, in order to obtain the possible ID, a complete - Search the text, then create a cyber match that limits the results of the id The literacy.
In the cipher, you can use IN [] to match the request within a record, then you MATCH (U: student {age: 30}). [1, 2, 3, 4] returns you in the ID (U). The trick to integrate ElasticShirch with Neo is to make it easier to build cipher questions around ES results. I really do not suggest doing so that it will depend on your language and driver.
In Neo4j.rb, I'm thinking about trying to automate it so that you can do this:
student.lessons (: l) .where (Name: 'Chris'). To_a ... and it will know that the text model is using Elasticsearch, do the query, and then change the query for the user, so it is effectively:
student.lessons (: l) .where ('id (L) IN {elasticsearch_results}'). Parachomes (LolalishShark_Rates: [1, 2, 3, 4]). To_a` I am using Searchkick for full-text search with Nive and it's running well. I think it is possible that there is no solution to your problem but I am thinking through it, so maybe it will give you some ideas.
It is worth noting that fuzzy search is using neo = ~ , it does not use index, therefore performance can be a hit, this is not a problem, However, since you have to inspect the cipher by adding more information to other parts of your query, you can then filter the number of nodes and properties. You can do some benchmark with your data to find out if the algorithmic overhead and more complex questions are necessary.
Comments
Post a Comment