GithubHelp home page GithubHelp logo

alexxnica / concept-search-index-mapping Goto Github PK

View Code? Open in Web Editor NEW

This project forked from financial-times/concept-search-index-mapping

0.0 1.0 0.0 19 KB

Elasticsearch mapping for the concept search index.

License: MIT License

Smarty 100.00%

concept-search-index-mapping's Introduction

concept-search-index-mapping

Elasticsearch mapping for the concept search index.

The Docker image built by this project is based on the elasticsearch-reindexer. It applies the mapping.json file for the concepts index.

Example Queries

People search using

  • the edge_ngram analyzer and a 0.1 boost on a term match
  • the isFTAuthor `1.81 boost
  • the exact_match analyzer
{
   "size" : 20,
   "query": {
      "bool": {
         "must": {
            "match" : {
                "prefLabel.edge_ngram": {
                    "query":"Donald Gi"
                }
            }
         },
         "filter": {
            "term": {
               "_type": "people"
            }
         },
         "should": [
            {
               "term": {
                  "isFTAuthor": {
                    "value": "true",
                    "boost": 1.8
                  }
               }
            },
            {
               "match": {
                  "prefLabel": {
                    "query": "Donald Gi",
                    "boost": 0.1
                  }
               }
            },
            {
                "match": {
                   "prefLabel.exact_match": {
                      "query": "Donald Gi",
                      "boost": 0.3
                   }
                }
             }
         ],
         "minimum_should_match": 0,
         "boost": 1
      }
   }
}

Abouts/Mentions using the edge_ngram analyzer and a 0.1 boost on a term match:

{
   "query": {
      "bool": {
         "must": {
            "match": {
               "prefLabel.edge_ngram": {
                  "query": "donald trump"
               }
            }
         },
         "filter": {
            "terms": {
               "_type": [
                  "people",
                  "topics",
                  "organisations",
                  "locations"
               ]
            }
         },
         "should": [
            {
               "match": {
                  "prefLabel": {
                     "query": "donald trump",
                     "boost": 0.1
                  }
               }
            }
         ],
         "boost": 1
      }
   }
}

Abouts/Mentions with an additional boost using the exact_match analyzer:

{
   "query": {
      "bool": {
         "must": {
            "match": {
               "prefLabel.edge_ngram": {
                  "query": "new york"
               }
            }
         },
         "filter": {
            "terms": {
               "_type": [
                  "people",
                  "topics",
                  "organisations",
                  "locations"
               ]
            }
         },
         "should": [
            {
               "match": {
                  "prefLabel": {
                     "query": "new york",
                     "boost": 0.1
                  }
               }
            },
            {
               "term": {
                  "prefLabel.exact_match": {
                     "value": "new york",
                     "boost": 0.5
                  }
               }
            }
         ],
         "boost": 1
      }
   }
}

Currently, only BRANDS search uses the suggester

@Deprecated Abouts/Mentions using the mentionsCompletion suggester:

{
   "suggest": {
      "conceptSuggestion": {
         "text": "oita",
         "completion": {
            "field": "prefLabel.mentionsCompletion"
         }
      }
   }
}

@Deprecated Author boost using the authorCompletionByContext suggester:

{
   "suggest": {
      "conceptSuggestion": {
         "text": "martin wol",
         "completion": {
            "field": "prefLabel.authorCompletionByContext",
            "contexts": {
               "authorContext": {
                  "context": "true",
                  "boost": 2
               },
               "typeContext": "people"
            }
         }
      }
   }
}

concept-search-index-mapping's People

Contributors

izzyblues avatar peteclark-ft avatar tamas-molnar avatar yolandeleungft avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.