{
  "schema_version": 2,
  "id": "develop/ai/search-and-query/query/full-text",
  "title": "Full-text search",
  "url": "https://redis.io/docs/latest/develop/ai/search-and-query/query/full-text/",
  "summary": "Perform a full-text search",
  "aliases": [
    "/develop/interact/search-and-query/query/full-text",
    "/interact/search-and-query/query/full-text/"
  ],
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-09-11T15:33:04+01:00",
  "page_type": "content",
  "content_hash": "fb5de03557893a9e11767e5af95d1b5811666a81a215719e08980b1b3c762252",
  "sections": [
    {
      "id": "single-word",
      "title": "Single word",
      "role": "content",
      "text": "To search for a word (or word stem) across all text fields, you can construct the following simple query:\n\n[code example]\n\nInstead of searching across all text fields, you might want to limit the search to a specific text field.\n\n[code example]\n\nWords that occur very often in natural language, such as `the` or `a` for the English language, aren't indexed and will not return a search result. You can find further details in the [stop words article](https://redis.io/docs/latest/develop/ai/search-and-query/advanced-concepts/stopwords).\n\nThe following example searches for all bicycles that have the word 'kids' in the description:\n\nFoundational: Search for single words across text fields using simple word queries when you need to find documents containing specific terms\n\n**Difficulty:** Beginner\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), Python\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### Python\n\n[code example]"
    },
    {
      "id": "phrase",
      "title": "Phrase",
      "role": "content",
      "text": "A phrase is a sentence, sentence fragment, or small group of words. You can find further details about how to find exact phrases in the [exact match article](https://redis.io/docs/latest/develop/ai/search-and-query/query/exact-match)."
    },
    {
      "id": "word-prefix",
      "title": "Word prefix",
      "role": "content",
      "text": "You can also search for words that match a given prefix.\n\n[code example]\n\n[code example]\n\n> [!NOTE] Important\n> The prefix needs to be at least two characters long.\n\nHere is an example that shows you how to search for bicycles with a brand that starts with 'ka':\n\nPrefix matching: Search for words with a specific prefix using wildcard syntax when you need to find documents with words starting with certain characters\n\n**Difficulty:** Intermediate\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), Python\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### Python\n\n[code example]"
    },
    {
      "id": "word-suffix",
      "title": "Word suffix",
      "role": "content",
      "text": "Similar to the prefix, it is also possible to search for words that share the same suffix.\n\n[code example]\n\nYou can also combine prefix- and suffix-based searches within a query expression.\n\n[code example]\n\nHere is an example that finds all brands that end with 'bikes':\n\nSuffix/infix matching: Search for words with a specific suffix or infix using wildcard syntax when you need to find documents with words ending or containing certain characters\n\n**Difficulty:** Intermediate\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), Python\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### Python\n\n[code example]"
    },
    {
      "id": "fuzzy-search",
      "title": "Fuzzy search",
      "role": "content",
      "text": "A fuzzy search allows you to find documents with words that approximately match your search term. To perform a fuzzy search, you wrap search terms with pairs of `%` characters. A single pair represents a (Levenshtein) distance of one, two pairs represent a distance of two, and three pairs, the maximum distance, represents a distance of three.\n\nHere is the command that searches across all text fields with a distance of one:\n\n[code example]\n\nThe following example finds all documents that contain a word that has a distance of one to the incorrectly spelled word 'optamized'. You can see that this matches the word 'optimized'.\n\nFuzzy search: Search for words with approximate matches using fuzzy search with single % delimiters when you need to find documents despite spelling variations or typos\n\n**Difficulty:** Intermediate\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), Python\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### Python\n\n[code example]\n\n\n\nIf you want to increase the maximum word distance to two, you can use the following query:\n\nFuzzy search: Search for words with larger approximate matches using fuzzy search with double %% delimiters when you need to tolerate greater spelling variations\n\n**Difficulty:** Intermediate\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), Python\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### Python\n\n[code example]"
    },
    {
      "id": "fuzzy-search-on-a-specific-attribute",
      "title": "Fuzzy search on a specific attribute",
      "role": "content",
      "text": "To perform a fuzzy search on a specific text field, use the `@field:(...)` syntax with the fuzzy term inside parentheses.\n\n[code example]\n\n> [!NOTE] Important\n> Do not use quotes around the fuzzy term when targeting a specific field. Wrapping the term in quotes (for example, `@field:(\"%word%\")`) converts the query into an exact match search, and the `%` characters are treated as literal characters rather than fuzzy operators.\n\nThe following example shows the correct way to perform a fuzzy search with distance one on the `description` field:\n\n[code example]\n\nFor a fuzzy search with distance two on a specific field:\n\n[code example]\n\nYou can also combine fuzzy searches on multiple fields using boolean operators:\n\n[code example]"
    },
    {
      "id": "unicode-considerations",
      "title": "Unicode considerations",
      "role": "content",
      "text": "Redis Search only supports Unicode characters in the [basic multilingual plane](https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_Multilingual_Plane); U+0000 to U+FFFF. Unicode characters beyond U+FFFF, such as Emojis, are not supported and would not be retrieved by queries including such characters in the following use cases:\n\n* Querying TEXT fields with Prefix/Suffix/Infix\n* Querying TEXT fields with fuzzy\n\nExamples:\n\n[code example]"
    }
  ],
  "examples": [
    {
      "id": "single-word-ex0",
      "language": "plaintext",
      "code": "FT.SEARCH index \"word\"",
      "section_id": "single-word"
    },
    {
      "id": "single-word-ex1",
      "language": "plaintext",
      "code": "FT.SEARCH index \"@field: word\"",
      "section_id": "single-word"
    },
    {
      "id": "single-word-ex2",
      "language": "plaintext",
      "code": "FT.SEARCH idx:bicycle \"@description: kids\"",
      "section_id": "single-word"
    },
    {
      "id": "single-word-ex3",
      "language": "csharp",
      "code": "SearchResult res1 = db.FT().Search(\n           \"idx:bicycle\",\n           new(\"@description: kids\")\n       );\n        Console.WriteLine(res1);    // >>> 2",
      "section_id": "single-word"
    },
    {
      "id": "single-word-ex4",
      "language": "go",
      "code": "res1, err := rdb.FTSearch(ctx,\n\t\t\"idx:bicycle\", \"@description: kids\",\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res1.Total) // >>> 2\n\n\tsort.Slice(res1.Docs, func(i, j int) bool {\n\t\treturn res1.Docs[i].ID < res1.Docs[j].ID\n\t})\n\n\tfor _, doc := range res1.Docs {\n\t\tfmt.Println(doc.ID)\n\t}\n\t// >>> bicycle:1\n\t// >>> bicycle:2",
      "section_id": "single-word"
    },
    {
      "id": "single-word-ex5",
      "language": "java",
      "code": "CompletableFuture<SearchReply<String, String>> descriptionResults = asyncCommands\n                    .ftSearch(\"idx:bicycle\", \"@description: kids\").thenApply(res -> {\n                        res.getResults().stream().sorted((doc1, doc2) -> doc1.getId().compareTo(doc2.getId())).forEach(doc -> {\n                            System.out.printf(\"ID: %s\\n\", doc.getId());\n                        });\n                        // >>> ID: bicycle:1\n                        // >>> ID: bicycle:2\n                        return res;\n                    }).toCompletableFuture();",
      "section_id": "single-word"
    },
    {
      "id": "single-word-ex6",
      "language": "java",
      "code": "Mono<SearchReply<String, String>> descriptionResults = reactiveCommands\n                    .ftSearch(\"idx:bicycle\", \"@description: kids\").doOnNext(res -> {\n                        res.getResults().stream().sorted((doc1, doc2) -> doc1.getId().compareTo(doc2.getId())).forEach(doc -> {\n                            System.out.printf(\"ID: %s\\n\", doc.getId());\n                            // >>> ID: bicycle:1\n                            // >>> ID: bicycle:2\n                        });\n                    });",
      "section_id": "single-word"
    },
    {
      "id": "single-word-ex7",
      "language": "java",
      "code": "SearchResult res1 = jedis.ftSearch(\"idx:bicycle\", \"@description: kids\");\n        System.out.println(res1.getTotalResults()); // >>> 2\n\n        List<Document> docs1 = res1.getDocuments();\n\n        for (int i = 0; i < docs1.size(); i++) {\n            System.out.println(docs1.get(i).getId());\n        }\n        // >>> bicycle:2\n        // >>> bicycle:1",
      "section_id": "single-word"
    },
    {
      "id": "single-word-ex8",
      "language": "javascript",
      "code": "const res1 = await client.ft.search('idx:bicycle', '@description: kids');\nconsole.log(res1.total); // >>> 2",
      "section_id": "single-word"
    },
    {
      "id": "single-word-ex9",
      "language": "python",
      "code": "res = index.search(Query(\"@description: kids\"))\nprint(res.total)\n# >>> 2",
      "section_id": "single-word"
    },
    {
      "id": "word-prefix-ex0",
      "language": "plaintext",
      "code": "FT.SEARCH index \"prefix*\"",
      "section_id": "word-prefix"
    },
    {
      "id": "word-prefix-ex1",
      "language": "plaintext",
      "code": "FT.SEARCH index \"@field: prefix*\"",
      "section_id": "word-prefix"
    },
    {
      "id": "word-prefix-ex2",
      "language": "plaintext",
      "code": "FT.SEARCH idx:bicycle \"@model: ka*\"",
      "section_id": "word-prefix"
    },
    {
      "id": "word-prefix-ex3",
      "language": "csharp",
      "code": "SearchResult res2 = db.FT().Search(\n            \"idx:bicycle\",\n            new(\"@model: ka*\")\n        );\n        Console.WriteLine(res2.TotalResults);   // >>> 1",
      "section_id": "word-prefix"
    },
    {
      "id": "word-prefix-ex4",
      "language": "go",
      "code": "res2, err := rdb.FTSearch(ctx,\n\t\t\"idx:bicycle\", \"@model: ka*\",\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res2.Total) // >>> 1\n\n\tfor _, doc := range res2.Docs {\n\t\tfmt.Println(doc.ID)\n\t}\n\t// >>> bicycle:4",
      "section_id": "word-prefix"
    },
    {
      "id": "word-prefix-ex5",
      "language": "java",
      "code": "CompletableFuture<SearchReply<String, String>> startsWithResults = asyncCommands\n                    .ftSearch(\"idx:bicycle\", \"@model: ka*\").thenApply(res -> {\n                        res.getResults().stream().sorted((doc1, doc2) -> doc1.getId().compareTo(doc2.getId())).forEach(doc -> {\n                            System.out.printf(\"ID: %s\\n\", doc.getId());\n                        });\n                        // >>> ID: bicycle:4\n                        return res;\n                    }).toCompletableFuture();",
      "section_id": "word-prefix"
    },
    {
      "id": "word-prefix-ex6",
      "language": "java",
      "code": "Mono<SearchReply<String, String>> startsWithResults = reactiveCommands.ftSearch(\"idx:bicycle\", \"@model: ka*\")\n                    .doOnNext(res -> {\n                        res.getResults().stream().sorted((doc1, doc2) -> doc1.getId().compareTo(doc2.getId())).forEach(doc -> {\n                            System.out.printf(\"ID: %s\\n\", doc.getId());\n                            // >>> ID: bicycle:4\n                        });\n                    });",
      "section_id": "word-prefix"
    },
    {
      "id": "word-prefix-ex7",
      "language": "java",
      "code": "SearchResult res2 = jedis.ftSearch(\"idx:bicycle\", \"@model: ka*\");\n        System.out.println(res2.getTotalResults()); // >>> 1\n\n        List<Document> docs2 = res2.getDocuments();\n\n        for (int i = 0; i < docs2.size(); i++) {\n            System.out.println(docs2.get(i).getId());\n        }\n        // >>> bicycle:4",
      "section_id": "word-prefix"
    },
    {
      "id": "word-prefix-ex8",
      "language": "javascript",
      "code": "const res2 = await client.ft.search('idx:bicycle', '@model: ka*');\nconsole.log(res2.total); // >>> 1",
      "section_id": "word-prefix"
    },
    {
      "id": "word-prefix-ex9",
      "language": "python",
      "code": "res = index.search(Query(\"@model: ka*\"))\nprint(res.total)\n# >>> 1",
      "section_id": "word-prefix"
    },
    {
      "id": "word-suffix-ex0",
      "language": "plaintext",
      "code": "FT.SEARCH index \"*suffix\"",
      "section_id": "word-suffix"
    },
    {
      "id": "word-suffix-ex1",
      "language": "plaintext",
      "code": "FT.SEARCH index \"*infix*\"",
      "section_id": "word-suffix"
    },
    {
      "id": "word-suffix-ex2",
      "language": "plaintext",
      "code": "FT.SEARCH idx:bicycle \"@brand:*bikes\"",
      "section_id": "word-suffix"
    },
    {
      "id": "word-suffix-ex3",
      "language": "csharp",
      "code": "SearchResult res3 = db.FT().Search(\n            \"idx:bicycle\",\n            new(\"@brand: *bikes\")\n        );\n        Console.WriteLine(res3.TotalResults);   // >>> 2",
      "section_id": "word-suffix"
    },
    {
      "id": "word-suffix-ex4",
      "language": "go",
      "code": "res3, err := rdb.FTSearch(ctx,\n\t\t\"idx:bicycle\", \"@brand: *bikes\",\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res3.Total) // >>> 2\n\n\tsort.Slice(res3.Docs, func(i, j int) bool {\n\t\treturn res3.Docs[i].ID < res3.Docs[j].ID\n\t})\n\tfor _, doc := range res3.Docs {\n\t\tfmt.Println(doc.ID)\n\t}\n\t// >>> bicycle:4\n\t// >>> bicycle:6",
      "section_id": "word-suffix"
    },
    {
      "id": "word-suffix-ex5",
      "language": "java",
      "code": "CompletableFuture<SearchReply<String, String>> endsWithResults = asyncCommands\n                    .ftSearch(\"idx:bicycle\", \"@brand: *bikes\").thenApply(res -> {\n                        res.getResults().stream().sorted((doc1, doc2) -> doc1.getId().compareTo(doc2.getId())).forEach(doc -> {\n                            System.out.printf(\"ID: %s\\n\", doc.getId());\n                        });\n                        // >>> ID: bicycle:4\n                        // >>> ID: bicycle:6\n                        return res;\n                    }).toCompletableFuture();",
      "section_id": "word-suffix"
    },
    {
      "id": "word-suffix-ex6",
      "language": "java",
      "code": "Mono<SearchReply<String, String>> endsWithResults = reactiveCommands.ftSearch(\"idx:bicycle\", \"@brand: *bikes\")\n                    .doOnNext(res -> {\n                        res.getResults().stream().sorted((doc1, doc2) -> doc1.getId().compareTo(doc2.getId())).forEach(doc -> {\n                            System.out.printf(\"ID: %s\\n\", doc.getId());\n                            // >>> ID: bicycle:4\n                            // >>> ID: bicycle:6\n                        });\n                    });",
      "section_id": "word-suffix"
    },
    {
      "id": "word-suffix-ex7",
      "language": "java",
      "code": "SearchResult res3 = jedis.ftSearch(\"idx:bicycle\", \"@brand: *bikes\");\n        System.out.println(res3.getTotalResults()); // >>> 2\n\n        List<Document> docs3 = res3.getDocuments();\n\n        for (int i = 0; i < docs3.size(); i++) {\n            System.out.println(docs3.get(i).getId());\n        }\n        // >>> bicycle:6\n        // >>> bicycle:4",
      "section_id": "word-suffix"
    },
    {
      "id": "word-suffix-ex8",
      "language": "javascript",
      "code": "const res3 = await client.ft.search('idx:bicycle', '@brand: *bikes');\nconsole.log(res3.total); // >>> 2",
      "section_id": "word-suffix"
    },
    {
      "id": "word-suffix-ex9",
      "language": "python",
      "code": "res = index.search(Query(\"@brand: *bikes\"))\nprint(res.total)\n# >>> 2",
      "section_id": "word-suffix"
    },
    {
      "id": "fuzzy-search-ex0",
      "language": "plaintext",
      "code": "FT.SEARCH index \"%word%\"",
      "section_id": "fuzzy-search"
    },
    {
      "id": "fuzzy-search-ex1",
      "language": "plaintext",
      "code": "FT.SEARCH idx:bicycle \"%optamized%\"",
      "section_id": "fuzzy-search"
    },
    {
      "id": "fuzzy-search-ex2",
      "language": "csharp",
      "code": "SearchResult res4 = db.FT().Search(\n            \"idx:bicycle\",\n            new(\"%optamized%\")\n        );\n        Console.WriteLine(res4.TotalResults);   // >>> 1",
      "section_id": "fuzzy-search"
    },
    {
      "id": "fuzzy-search-ex3",
      "language": "go",
      "code": "res4, err := rdb.FTSearch(ctx,\n\t\t\"idx:bicycle\", \"%optamized%\",\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res4.Total) // >>> 1\n\n\tfor _, doc := range res4.Docs {\n\t\tfmt.Println(doc.ID)\n\t}\n\t// >>> bicycle:3",
      "section_id": "fuzzy-search"
    },
    {
      "id": "fuzzy-search-ex4",
      "language": "java",
      "code": "CompletableFuture<SearchReply<String, String>> fuzzyResults = asyncCommands.ftSearch(\"idx:bicycle\", \"%optamized%\")\n                    .thenApply(res -> {\n                        res.getResults().stream().sorted((doc1, doc2) -> doc1.getId().compareTo(doc2.getId())).forEach(doc -> {\n                            System.out.printf(\"ID: %s\\n\", doc.getId());\n                        });\n                        // >>> ID: bicycle:3\n                        return res;\n                    }).toCompletableFuture();",
      "section_id": "fuzzy-search"
    },
    {
      "id": "fuzzy-search-ex5",
      "language": "java",
      "code": "Mono<SearchReply<String, String>> fuzzyResults = reactiveCommands.ftSearch(\"idx:bicycle\", \"%optamized%\")\n                    .doOnNext(res -> {\n                        res.getResults().stream().sorted((doc1, doc2) -> doc1.getId().compareTo(doc2.getId())).forEach(doc -> {\n                            System.out.printf(\"ID: %s\\n\", doc.getId());\n                            // >>> ID: bicycle:3\n                        });\n                    });",
      "section_id": "fuzzy-search"
    },
    {
      "id": "fuzzy-search-ex6",
      "language": "java",
      "code": "SearchResult res4 = jedis.ftSearch(\"idx:bicycle\", \"%optamized%\");\n        System.out.println(res4.getTotalResults()); // >>> 1\n\n        List<Document> docs4 = res4.getDocuments();\n\n        for (int i = 0; i < docs4.size(); i++) {\n            System.out.println(docs4.get(i).getId());\n        }\n        // >>> bicycle:3",
      "section_id": "fuzzy-search"
    },
    {
      "id": "fuzzy-search-ex7",
      "language": "javascript",
      "code": "const res4 = await client.ft.search('idx:bicycle', '%optamized%');\nconsole.log(res4); // >>> { total: 1, documents: [ { id: 'bicycle:3', value: [Object: null prototype] } ]}",
      "section_id": "fuzzy-search"
    },
    {
      "id": "fuzzy-search-ex8",
      "language": "python",
      "code": "res = index.search(Query(\"%optamized%\"))\nprint(res)\n# >>> Result{1 total, docs: [Document {'id': 'bicycle:3', 'payload': None, 'json': '{\"pickup_zone\":\"POLYGON((-80.2433 25.8067, -80.1333 25.8067, -80.1333 25.6967, -80.2433 25.6967, -80.2433 25.8067))\",\"store_location\":\"-80.1918,25.7617\",\"brand\":\"Eva\",\"model\":\"Eva 291\",\"price\":3400,\"description\":\"The sister company to Nord, Eva launched in 2005 as the first and only women-dedicated bicycle brand. Designed by women for women, allEva bikes are optimized for the feminine physique using analytics from a body metrics database. If you like 29ers, try the Eva 291. It’s a brand new bike for 2022.. This full-suspension, cross-country ride has been designed for velocity. The 291 has 100mm of front and rear travel, a superlight aluminum frame and fast-rolling 29-inch wheels. Yippee!\",\"condition\":\"used\"}'}]}",
      "section_id": "fuzzy-search"
    },
    {
      "id": "fuzzy-search-ex9",
      "language": "plaintext",
      "code": "FT.SEARCH idx:bicycle \"%%optamised%%\"",
      "section_id": "fuzzy-search"
    },
    {
      "id": "fuzzy-search-ex10",
      "language": "csharp",
      "code": "SearchResult res5 = db.FT().Search(\n            \"idx:bicycle\",\n            new(\"%%optamised%%\")\n        );\n        Console.WriteLine(res5.TotalResults);   // >>> 1",
      "section_id": "fuzzy-search"
    },
    {
      "id": "fuzzy-search-ex11",
      "language": "go",
      "code": "res5, err := rdb.FTSearch(ctx,\n\t\t\"idx:bicycle\", \"%%optamised%%\",\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res5.Total) // >>> 1\n\n\tfor _, doc := range res5.Docs {\n\t\tfmt.Println(doc.ID)\n\t}\n\t// >>> bicycle:3",
      "section_id": "fuzzy-search"
    },
    {
      "id": "fuzzy-search-ex12",
      "language": "java",
      "code": "CompletableFuture<SearchReply<String, String>> fuzzierResults = asyncCommands\n                    .ftSearch(\"idx:bicycle\", \"%%optamised%%\").thenApply(res -> {\n                        res.getResults().stream().sorted((doc1, doc2) -> doc1.getId().compareTo(doc2.getId())).forEach(doc -> {\n                            System.out.printf(\"ID: %s\\n\", doc.getId());\n                        });\n                        // >>> ID: bicycle:3\n                        return res;\n                    }).toCompletableFuture();",
      "section_id": "fuzzy-search"
    },
    {
      "id": "fuzzy-search-ex13",
      "language": "java",
      "code": "Mono<SearchReply<String, String>> fuzzierResults = reactiveCommands.ftSearch(\"idx:bicycle\", \"%%optamised%%\")\n                    .doOnNext(res -> {\n                        res.getResults().stream().sorted((doc1, doc2) -> doc1.getId().compareTo(doc2.getId())).forEach(doc -> {\n                            System.out.printf(\"ID: %s\\n\", doc.getId());\n                            // >>> ID: bicycle:3\n                        });\n                    });",
      "section_id": "fuzzy-search"
    },
    {
      "id": "fuzzy-search-ex14",
      "language": "java",
      "code": "SearchResult res5 = jedis.ftSearch(\"idx:bicycle\", \"%%optamised%%\");\n        System.out.println(res5.getTotalResults()); // >>> 1\n\n        List<Document> docs5 = res5.getDocuments();\n\n        for (int i = 0; i < docs5.size(); i++) {\n            System.out.println(docs5.get(i).getId());\n        }\n        // >>> bicycle:3",
      "section_id": "fuzzy-search"
    },
    {
      "id": "fuzzy-search-ex15",
      "language": "javascript",
      "code": "const res5 = await client.ft.search('idx:bicycle', '%%optamised%%');\nconsole.log(res5); // >>> { total: 1, documents: [ { id: 'bicycle:3', value: [Object: null prototype] } ]}",
      "section_id": "fuzzy-search"
    },
    {
      "id": "fuzzy-search-ex16",
      "language": "python",
      "code": "res = index.search(Query(\"%%optamised%%\"))\nprint(res)\n# >>> Result{1 total, docs: [Document {'id': 'bicycle:3', 'payload': None, 'json': '{\"pickup_zone\":\"POLYGON((-80.2433 25.8067, -80.1333 25.8067, -80.1333 25.6967, -80.2433 25.6967, -80.2433 25.8067))\",\"store_location\":\"-80.1918,25.7617\",\"brand\":\"Eva\",\"model\":\"Eva 291\",\"price\":3400,\"description\":\"The sister company to Nord, Eva launched in 2005 as the first and only women-dedicated bicycle brand. Designed by women for women, allEva bikes are optimized for the feminine physique using analytics from a body metrics database. If you like 29ers, try the Eva 291. It’s a brand new bike for 2022.. This full-suspension, cross-country ride has been designed for velocity. The 291 has 100mm of front and rear travel, a superlight aluminum frame and fast-rolling 29-inch wheels. Yippee!\",\"condition\":\"used\"}'}]}",
      "section_id": "fuzzy-search"
    },
    {
      "id": "fuzzy-search-on-a-specific-attribute-ex0",
      "language": "plaintext",
      "code": "FT.SEARCH index \"@field:(%word%)\"",
      "section_id": "fuzzy-search-on-a-specific-attribute"
    },
    {
      "id": "fuzzy-search-on-a-specific-attribute-ex1",
      "language": "plaintext",
      "code": "FT.SEARCH idx:bicycle \"@description:(%optamized%)\"",
      "section_id": "fuzzy-search-on-a-specific-attribute"
    },
    {
      "id": "fuzzy-search-on-a-specific-attribute-ex2",
      "language": "plaintext",
      "code": "FT.SEARCH idx:bicycle \"@description:(%%optamised%%)\"",
      "section_id": "fuzzy-search-on-a-specific-attribute"
    },
    {
      "id": "fuzzy-search-on-a-specific-attribute-ex3",
      "language": "plaintext",
      "code": "FT.SEARCH idx:bicycle \"@description:(%optamized%) | @model:(%jigar%)\"",
      "section_id": "fuzzy-search-on-a-specific-attribute"
    },
    {
      "id": "unicode-considerations-ex0",
      "language": "plaintext",
      "code": "redis> FT.CREATE idx SCHEMA tag TAG text TEXT\nOK\nredis> HSET doc:1 tag '😀😁🙂' text '😀😁🙂'\n(integer) 2\nredis> HSET doc:2 tag '😀😁🙂abc' text '😀😁🙂abc'\n(integer) 2\nredis> FT.SEARCH idx '@text:(*😀😁🙂)' NOCONTENT\n1) (integer) 0\nredis> FT.SEARCH idx '@text:(*😀😁🙂*)' NOCONTENT\n1) (integer) 0\nredis> FT.SEARCH idx '@text:(😀😁🙂*)' NOCONTENT\n1) (integer) 0\n\nredis> FT.SEARCH idx '@text:(%😀😁🙃%)' NOCONTENT\n1) (integer) 0",
      "section_id": "unicode-considerations"
    }
  ]
}
