0

I have the following situation:

I have a person with default fields like: Name, FirstName, Phone, Email, ...

A person has many languageskills, the languageskill entity has the following fields: Language, Speaking, Writing, Understanding, Mothertongue

A person has many workexperiences, with fields: Office, Description, Period, Location

How would I index something like this with Lucene.net?

The following searches could be possible:

 - FirstName:"Arno" AND LanguageSkill:(Language:"Dutch" AND Speaking:[3 TO 5])
 - FirstName:"Arno" AND WorkExperience:(Description:"Marketing")
 - FirstName:"Arno" AND WorkExperience:(Description:"Marketing" OR Description:"Sales")
 - FirstName:"Arno" AND WorkExperience:(Description:"Programmer") AND LanguageSkill:(Language:"English" AND Speaking:[3 TO 5] AND MotherTongue:"true")

Would something like this be possible in Lucene, I've tried flattening my relations already where a document could look like this:

Name:"Stallen"
FirstName:"Arno"
WorkExperience:"Office=Lidl Description=Sales Location=London"
WorkExperience:"Office=Abro Description=Programmer Location=London"
LanguageSkill:"Language=Dutch Speaking=3 Writing=1 Understanding=3"
LanguageSkill:"Language=Egnlish Speaking=5 Writing=4 Understanding=5 MotherTongue=true"

2 Answers 2

1

"if all you have is a hammer, everything looks like a nail"

Your requirements suit better to relational databases. I would go that way since I don't see anything related with free text search

However if you have to use Lucene.Net you should flatten your data a little bit more such as

Name:"Stallen"
FirstName:"Arno"
WorkExperienceDescription:Sales
WorkExperienceLocation:London
LanguageSkillLanguage:Dutch
LanguageSkillLanguage:English

Of course this would result in some info loss and you would not be able to make a search like

FirstName:"Arno" AND LanguageSkill:(Language:"Dutch" AND Speaking:[3 TO 5])

PS: You can use the same fieldname (ex., LanguageSkillLanguage) multiple times in a single document.

Sign up to request clarification or add additional context in comments.

1 Comment

Yeah that's the problem, I need exactly the combination of Location and Description for example. And one person has more than one of those. Problem is querying the database would result in extreme speed loss. I've seen child parent documents in Lucene (Java). Maybe I should try the Java version instead. Explained in the following slideshow: slideshare.net/MarkHarwood/…
1

I ended up using the Java version of Lucene (3.6) which contains parent child documents. I used IKVM to generate the .net DLL out of it.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.