[ 
https://issues.apache.org/jira/browse/UNOMI-232?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16862324#comment-16862324
 ] 

Casey Sybrandy commented on UNOMI-232:
--------------------------------------

Not going to say it's perfect, but here's what I came up with:

 
{noformat}
{
    "query":{
        "function_score":{
            "query":{
                "bool":{
                    "should":[
                        {"match":{"itemType":"profile"}},
                        {"match":{"properties.org":"ORG2 ORG1"}},
                        
{"terms":{"properties.areasOfInterest":["alpha","bravo"]}},
                        
{"terms":{"properties.areasOfResponsibility":["charlie","delta"]}},
                        {"terms":{"properties.geographicAreas":["USA","CAN"]}},
                        {"terms":{"properties.term_list":["ibm"]}}
                    ],
                    "must_not":{"match":{"itemId":"some_ugly_id"}},
                    "must":{"exists":{"field":"properties.sid"}}
                }
            },
            "functions":[
                {"filter":{"match":{"properties.org":"ORG1"}},"weight":1.2},
                
{"filter":{"terms":{"properties.areasOfInterest":["alpha","bravo"]}},"weight":1.4},
                
{"filter":{"terms":{"properties.areasOfResponsibility":["charlie","delta"]}},"weight":1},
                
{"filter":{"terms":{"properties.geographicAreas":["USA","CAN"]}},"weight":1.2},
                {"filter":{"terms":{"properties.term_list":["ibm"]}},"weight":1}
            ]
        }
    },
    "sort":{
        "_score":{"order":"desc"}},
        "from":0,
        "size":5,
        
"_source":["itemId","properties.firstName","properties.lastName","properties.email","properties.org","properties.areasOfInterest","properties.geographicAreas"]
    }
}{noformat}
The goal was to find users that matched, excluding the current user, and apply 
some scoring to make certain fields more important than others.  Granted, the 
properties will need to be dynamic as different users may have different 
properties they want to match on.

 

> Add ability to discover similar users.
> --------------------------------------
>
>                 Key: UNOMI-232
>                 URL: https://issues.apache.org/jira/browse/UNOMI-232
>             Project: Apache Unomi
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.3.0-incubating
>            Reporter: Casey Sybrandy
>            Priority: Major
>
> Hello,
> We are currently prototyping a system and one of the pieces of functionality 
> that's been requested is the ability to find users that are similar to each 
> other.  For example, if this is a site for allowing people to search for 
> research papers, the site can recommend other users based on my searches, 
> which could be tracked via Unomi, so that I may be able to contact them and 
> see if they're performing similar research and potentially collaborate.  
> Currently we are accessing ElasticSearch to do this because while there is a 
> search API in Unomi, we can't control the ranking by prioritizing certain 
> fields over others.
> Ideally, the endpoint should:
>  # Allow the developer to specify which fields should be used for matching 
> users.
>  # Allow the developer to adjust the ranking of the results by prioritizing 
> certain fields over others.
>  # Return the results in order of best match to worst match with the ability 
> to limit the number of results.
> Thanks.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to