Hi, You could simply create an autocomplete Solr Core with a simple schema consisting of id, from, to: Let the fieldType of "from" be String, and in the fieldType of "to" you can use StandardTokenizer, WordDelimiterFilter and EdgeNGramFilter.
<add> <doc> <field name="id">john....@mycompany.com-jane.doe@mycompany.com</field> <field name="from">john....@mycompany.com</field> <field name="to">Jane Doe (jane....@mycompany.com)</field> </doc> <doc> <field name="id">john....@mycompany.com-thomas.doe@mycompany.com</field> <field name="from">john....@mycompany.com</field> <field name="to">Thomas Doe (thomas....@mycompany.com)</field> </doc> <doc> <field name="id">peter....@mycompany.com-another.doe@mycompany.com</field> <field name="from">peter....@mycompany.com</field> <field name="to">Another Doe (another....@mycompany.com)</field> </doc> </add> Now, if your autocomplete query is like this: wt=json&fl=to&qf=from:"john....@mycompany.com"&q={!q.op=AND df=to}do Your response will now be a list of valid recepients where the from field is current user. By using EdgeNGramFilter in the "to" field, you get the effect of an automatic wildcard search since "John Doe" will be indexed as (conceptually) "J Jo Joh John D Do Doe" -- Jan Høydahl, search solution architect Cominvent AS - www.cominvent.com On 20. sep. 2010, at 12.36, Stefan Matheis wrote: > Hi List, > > this is my first message on this list, so if there's something > missing/incorrect, please let me know :) > > the current problem, described in short words followed by an short example, > is the following one: > > users can send privates messages, the selection of recipients is done via > auto-complete. therefore we need to restrict the possible results based on > the users confirmed contacts - but i have absolutely no idea how to do that > :/ Add all confirmed contacts to the index, and use it like a type of > relation? pass the list of confirmed contacts together with the query? > > let's say we have "John Doe" which creates a new message. typing "doe" > should suggest "Jane Doe", "Thomas Doe" - but not "Another Doe", which is > also a user, but none of his confirmed Contacts. Maybe we get also "John > Doe" as possible match, but that should be okay in the first place - if we > could exclude the user himself also, that's of course better. > > every user-record has an id, additional fields for firstname and lastname. > confirmed contacts are simply explained records with field from:user-id > to:user-id, actually with no additional information about type of > relationship or something. but nothing of this relationship-information is > currently submitted to the solr-index. > > if you need more information to answer this not-very-concrete question (and > i'm sure, i've missed some relevant info) just ask, please :) > > Regards > Stefan