I'm trying to put together a query in Solr that is becoming rather
complicated, and I'm not quite sure where to even start.
I'm building a directory, which for simplicity sake contains:
First Name
Last Name
Department Name (if faculty / staff)
User Types - faculty, staff, student - multivalued.
I want one search field to search first, last, and department. I have
that working. However, that means you can find students using a first
name only search, which isn't exactly desirable, but it is desirable for
faculty and staff.
So I want:
Search Department Name + Last Name every time
include First Name if user type in (faculty, staff) or if another token
matched last name.
So searching for "richard" would only work for me if I'm marked as
faculty or staff. However searching for "frovarp richard" would limit to
my record if I was marked as a student as the frovarp piece would match
against last names.
Any suggestions or ideas? I'm testing against Solr 4.3.1, but will
probably be updating to 4.5.1 anyway.
I'm open to multiple cores or searches. I actually have 4 different
first and last name fields (full, ngram, two phonetic), so scoring
becomes important.
Thanks,
Richard