Search Engine for Books

Hello,

We are using OpenSearch to index a i18n book database (more then 2 millions of documents)

While this works on the whole, we are having problems with the following case:

How to handle the input of user like “Edgar Allan Poe”, how to boost in first results books from this autor exactly and only then books with title exactly “Edgar Allan Poe” and finally books with author or title which contain Edgar OR Allan Or Poe.

We tried a lot of test with match or match_phrase, but there are always contradictions, and giving more weight to one use case will degrade another.

We have added a suggestion module to limit the number of cases, by suggesting authors more quickly, but this is not yet sufficient.

Here our partial mappings :

{
  "settings": {
    "analysis": {
      "analyzer": {
        "french_standard": {
          "tokenizer": "standard",
          "filter": ["lowercase", "asciifolding", "french_synonyms", "french_stop"]
        },
        "spanish_standard": {
          "tokenizer": "standard",
          "filter": ["lowercase", "asciifolding", "spanish_stop"]
        },
        "english_standard": {
          "tokenizer": "standard",
          "filter": ["lowercase", "asciifolding", "english_stop"]
        }
      },
      "filter": {
        "french_stop": {
          "type": "stop",
          "stopwords": "_french_"
        },
        "french_synonyms":{
          "type": "synonym",
          "synonyms_path": "synonyms/synonyms_french.txt"
        },
        "spanish_stop": {
          "type": "stop",
          "stopwords": "_spanish_"
        },
        "english_stop": {
          "type": "stop",
          "stopwords": "_english_"
        },
      }
    }
  },
  "mappings": {
    "dynamic": "strict",
    "properties": {
      "id": {
        "type": "keyword"
      },
      "product_id": {
        "type": "keyword"
      },
      "ean": {
        "type": "keyword"
      },
      "title": {
        "type": "text",
        "analyzer": "standard",
        "fields": {
          "suggest": {
            "type": "search_as_you_type"
          },
          "completion": {
            "type": "completion"
          },
          "keyword": { 
            "type": "keyword"
          }
        }
      },
      "mainauthor": {
        "type": "text",
        "analyzer": "standard",
        "fields": {
          "suggest": {
            "type": "search_as_you_type"
          },
          "completion": {
            "type": "completion"
          },
          "keyword": { 
            "type": "keyword"
          }
        }
      },
      "title_fre": {
        "type": "text",
        "analyzer": "french_standard",
        "fields": {
          "suggest": {
            "type": "search_as_you_type"
          },
          "completion": {
            "type": "completion"
          },
          "keyword": { 
            "type": "keyword"
          }
        }
      },
      "title_spa": {
        "type": "text",
        "analyzer": "spanish_standard",
        "fields": {
          "suggest": {
            "type": "search_as_you_type"
          },
          "completion": {
            "type": "completion"
          },
          "keyword": { 
            "type": "keyword"
          }
        }
      },
      "title_eng": {
        "type": "text",
        "analyzer": "english_standard",
        "fields": {
          "suggest": {
            "type": "search_as_you_type"
          },
          "completion": {
            "type": "completion"
          },
          "keyword": { 
            "type": "keyword"
          }
        }
      },
      "publication_date": {
        "type": "date", "format": "yyyy-MM-dd" 
      },
    }
  }
}

May be we missed something ?

Thanks

Yathus