Set Priority While Inserting Data

Hi All,

I have a mapping in the following format .

"mappings": {
        "user_profiles": {
            "properties": {
                "firstName": {
                    "properties": {                  
                        "pan": {
                            "type": "string",
                            "analyzer": "nGramAnalyzer",
                            "search_analyzer": "whitespaceAnalyzer"
                        },
                        "google": {
                            "type": "string",
                            "analyzer": "nGramAnalyzer",
                            "search_analyzer": "whitespaceAnalyzer"
                        },
                        "fb": {
                            "type": "string",
                            "analyzer": "nGramAnalyzer",
                            "search_analyzer": "whitespaceAnalyzer"
                        },
                        "twiter": {
                            "type": "string",
                            "analyzer": "nGramAnalyzer",
                            "search_analyzer": "whitespaceAnalyzer"
                        }                 
                    }               
                },
                "lastName": {
                    "properties": {                  
                        "pan": {
                            "type": "string",
                            "analyzer": "nGramAnalyzer",
                            "search_analyzer": "whitespaceAnalyzer"                    
                        },
                        "google": {
                            "type": "string",
                            "analyzer": "nGramAnalyzer",
                            "search_analyzer": "whitespaceAnalyzer"
                        },
                        "fb": { 
                            "type": "string",
                            "analyzer": "nGramAnalyzer",
                            "search_analyzer": "whitespaceAnalyzer"
                        },
                        "twiter": {
                            "type": "string",
                            "analyzer": "nGramAnalyzer",
                            "search_analyzer": "whitespaceAnalyzer"
                        }                 
                    }               
                }
            }
        }
    }

i will insert data into elastic search. but the thing is that while searching i need to get names in the order of precedence.

For Ex: if the user has pan.fb,twitter. I need to display the pan first name.Is there a way to set priority to fields so top priority field will be returned?

Returned when, and how?

For Ex if user first come from Facebook his first name record will be inserted as .
{
"firstName" : {
"fb" : " John"
}
}

But if user entered the pan card details in my application the record will be inserted as for same user id above
{
"firstName" : {
"pan" : " Johns"
}
}

Now the result look like this

{
"firstName" : {
"fb" : " John",
"pan" : " Johns"
}
}

Now while fetching data i need to get the data in the priority which i said. While searching for the user id the result for me should return
{
"firstName" : " Johns"
}

My Priority is
1.Pan
2.google
3.fb
4.twitter

There's no way to do this in ES.