gogel | The little browser engine
kandi X-RAY | gogel Summary
kandi X-RAY | gogel Summary
The little browser engine that couldn’t. A toy project for learning Go.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- main is the entrypoint .
- parseNodes parses a list of nodes .
- Walk walks the node tree rooted at the given level .
- NewElementNode returns a new ElementNode .
- Parse returns a list of nodes .
- NewParser returns a new Parser
- NewTextNode returns a new text node .
gogel Key Features
gogel Examples and Code Snippets
Community Discussions
Trending Discussions on gogel
QUESTION
My goal is to do two different kinds of searches for documents using neo4j. I'll use recipes(documents) for my example. Say I have a list of ingredients(key-words) on-hand (milk, butter, flour, salt, sugar, eggs...) and I have some recipes in my database with ingredients attached to each recipe. I'd like to input my list and get two different results. One would be the recipes that most closely include ALL the ingredients I entered. The second would be combinations of recipes that together include all of my ingredients.
Given: milk, butter, flour, salt, sugar, eggs
a search result for the first case might be:
1.)Sugar cookies
2.)Butter cookies
A result for the second might be:
1.)Flat bread and Gogel-Mogel
I'm reading in recipes to insert into neo4j, and pulling out the ingredients from the ingredients list at the top of each recipe, but then also from the recipe instructions. I want to weigh these differently, maybe 60/40 in favor of the ingredients list.
I would also like to stem each ingredient in case people enter similar words.
I'm struggling to come up with a good data model in neo4j. I plan for a user to enter English ingredients, and I will stem them in the background, and use that for searching on.
My first thought was: This is intuitive to me but is a lot of hops to find all the recipes.
Next maybe this:
Which gets to the recipes directly from the stems, but I would need to pass recipe ids in the relationships(right?) to get to the actual ingredients.
Third, maybe combine them like this? but there's lots of duplication.
Here are also some CYPHER statements to create the first idea:
...ANSWER
Answered 2017-Sep-26 at 05:44I would go with your version 1).
Don't worry about the additional hops. You would put the information about the amount / weight on the relationship between recipe and actual ingredient.
You can have multiple relationships.
Here is an example query, that doesn't work with your dataset as you have no recipe which has all ingredients:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install gogel
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page