I've got a basic Examine collection created, indexing a member's first name, middle name and last name. I can get a basic search to function, say if I just search for their last name.
What would be the best way to search when you don't know the exact criteria someone may use? For example, they could enter just a last name, just a first name, a first and a last name, a first and middle and last name, or maybe they enter two names which turn out to be middle and last name.
Should I create index columns of all the variations of a person's name? Can I perform the search above with some fancy examine query? What's the best practice?
If you don't use the fluent API and just pass the string into the search method it should search across all fields.
Failing that there is nothing wrong with just using the Or operations to search across each fields.
There's no real way you can define best practice for search, everyones index will be different and everyones needs will be different. You're best off at looking at your needs and how to achieve them with the API at hand.
Examine: Search Person Name - Best Practice
I've got a basic Examine collection created, indexing a member's first name, middle name and last name. I can get a basic search to function, say if I just search for their last name.
What would be the best way to search when you don't know the exact criteria someone may use? For example, they could enter just a last name, just a first name, a first and a last name, a first and middle and last name, or maybe they enter two names which turn out to be middle and last name.
Should I create index columns of all the variations of a person's name? Can I perform the search above with some fancy examine query? What's the best practice?
If you don't use the fluent API and just pass the string into the search method it should search across all fields.
Failing that there is nothing wrong with just using the Or operations to search across each fields.
There's no real way you can define best practice for search, everyones index will be different and everyones needs will be different. You're best off at looking at your needs and how to achieve them with the API at hand.
is working on a reply...