How to rank an attribute with exact search match above other attributes with partial match


This is an example JSON document I have in my index.

  "page_main_title": " Google Container Registry",
  "page_main_heading": "GCR integration",
  "page_headings": {
    "heading1": "Adding the Account Integration",
    "heading2": "Editing your GCR integration",
    "heading3": "Deleting your GCR integration"
  "page_paragraphs": {
    "paragraph1": "An GCR integration lets you configure the following scenarios:",
    "paragraph2": "The integration will now be available to all your continuous integration and deployment workflows.",
    "paragraph3": "To learn how to use the integration for your scenario, check out the tutorials below.",
    "paragraph4": " Pulling a Docker image from GCR [TODO when added]",
    "paragraph5": " Using a Docker image from GCR to spin up your CI container [TODO when added]",
    "paragraph6": " Build a Docker image [TODO when added]",
    "paragraph7": " Push a Docker image to GCR ",
    "paragraph8": "You can go to your Account Settings at any time, click on Integrations in the left sidebar menu, and click the Edit button for your GCR integration. You can then change integration name and JSON key.",
    "paragraph9": "However, you cannot edit the list of Subscriptions that are allowed to use the integration from this page. To add your integration to additional Subscriptions, read our Adding your integration to additional Subscriptions section ",
    "paragraph10": "If you no longer need the integration, you can delete it by following the steps below.",
    "paragraph11": "Go to each Subscription listed in the dependencies and delete it from each.",
    "paragraph12": "From the Subsciption dropdown menu at the top left of your Dashboard, click on the dependent Subscription.",
    "paragraph13": "Go to the Settings tab and click on Integrations in the left sidebar."
  "page_listitems": {
    "list_item1": "Pull a private image for your CI workflow",
    "list_item2": "Build a Docker image which has a FROM that pulls a private image",
    "list_item3": "Push an image as part of CI",
    "list_item4": "Use an image resource as part of your CD pipeline.",
    "list_item5": "Click on the gear icon for Account Settings in your top navigation bar and then click on the Integrations section.",
    "list_item6": "Click on the Add Integration button.",
    "list_item7": "Choose GCR from the list of integration types.",
    "list_item8": "For Integration Name use a distinctive name that's easy to associate to the integration and recall. Example: gcr_integration ",
    "list_item9": "Enter your JSON key that you have create on Google Developer Console. For more on JSON keys and Service accounts, read <a href=\" target=\"_blank\"> Google's docs .",
    "list_item10": "Assign this integration to the Subscription(s) you want to use it in. Since you're likely a member of many organizations, you need to specify which of them can use this integration.",
    "list_item11": "Click on Save ",
    "list_item12": "Go to your Account Settings by clicking on the gear icon in the top navigation bar.",
    "list_item13": "Click on Integrations in the left sidebar menu",
    "list_item14": "Locate the integration you want to delete and click on the Delete button.",
    "list_item15": "If there are no Subscriptions using this integration, you will be able to delete it by clicking on Yes . You are done at this point.",
    "list_item16": "If your integration is being used by any Subscriptions, you will see a message telling you which Subscriptions are still using the integration.",
    "list_item17": "Delete the integration.",
    "list_item18": "Once you have deleted the integration from all Subscriptions, you can go back to Account Settings and delete the integration."
  "objectID": "2327562"
  1. For the search term “An GCR integration lets you”, I get multiple matches.

However, I want Algolia to return paragraph1 as the highest rank result since it matches the most number of words and in the right order for the search term. How should I configure the ranking so that attributes which match the maximum number of search keywords rank the highest?

    "paragraph1": "An GCR integration lets you configure the following scenarios:"

Hi @ambarish,

To achieve this, you will have to setup a custom ranking formula. This let you order matching attributes regarding certain criterias. The criteria you are looking for is exact.

Best regards,