93 Commits

Author SHA1 Message Date
Kishore Nallan
aa439c1ea6 Fix long queries causing highlighter to misbehave and sometimes crash.
A window of size 10 is used by the highlighter to mark overlap with query text. When query length exceeded 10 tokens, this caused the highlighter to break.
2019-06-25 12:20:07 +05:30
Kishore Nallan
a2e3d5ac79 Fix facet counts not showing up in wildcard searches. 2019-06-14 08:37:27 +05:30
Kishore Nallan
d524b08884 Add test for bad import JSON. 2019-05-26 21:06:01 +05:30
Kishore Nallan
ba205222b7 Refactor bulk indexing process. 2019-05-25 22:28:13 +05:30
Kishore Nallan
2f0f3f9c9a Pull index count into configs. 2019-05-14 19:35:15 +05:30
Kishore Nallan
8f167dd7df Test for import. 2019-05-11 17:07:23 +05:30
Kishore Nallan
e1db28a153 When a facet field is filtered upon, search should be verbatim instead of normalizing the filter_by value.
There was also a difference in the behavior between string and string array facet fields which is corrected in this PR.

Fixes https://github.com/typesense/typesense/issues/54
2019-04-22 20:58:54 +05:30
Kishore Nallan
6bb139399d Fixed an edge case that causes overflow when querying large string fields. 2018-06-08 20:59:14 +05:30
Kishore Nallan
c5b7f3c7e2 Return snippets of best matched array elements instead of just the best matched element.
However, we limit the number of snippets returned to 5 for now.
2018-05-22 14:48:25 +05:30
Kishore Nallan
0014e19ea6 Highlighting should include all search fields, and not just the best matched field. 2018-05-14 14:11:14 +05:30
Kishore Nallan
2d7e75caa5 Support wildcard query: using a * would ignore the search query and consider all records for filter+sort. 2018-05-12 09:48:29 +05:30
Kishore Nallan
95112a8086 Support inclusion and exclusion of document fields that are returned in search response. 2018-05-08 07:53:13 +05:30
Kishore Nallan
46983ba6b4 Simplify the structure of the "highlight" field in response. 2018-05-05 17:48:04 +05:30
Kishore Nallan
56ed39e3ff Refactor topster to ensure that it handles insertion of duplicate keys.
Instead of ignoring a duplicate blindly, ignore when match score is less than existing key.
2018-04-30 20:28:56 +05:30
Kishore Nallan
1d1cd2459b When multiple fields are searched, the same document should not be returned twice. 2018-04-24 17:49:04 +05:30
Kishore Nallan
33552ca627 Change structure of hightlight in response to allow sending the matched array index. 2018-04-23 21:54:08 +05:30
Kishore Nallan
d4d1a9e3bd Fuzzy prefix searching should rely on the intermediate cost rather than the final cost.
Since we are only trying to match the prefix part, comparing the prefix with the full string makes no sense.
2018-04-21 20:14:10 +05:30
Kishore Nallan
b669a47c29 Highlight best matched string in an array.
An ARRAY_SEPARATOR delimiter is used to demarcate offsets of tokens from different indices of an array. Plain string fields are treated like a single-element array field, but without needing to use a delimiter.
2018-04-20 16:44:17 +05:30
Kishore Nallan
b186816ca5 Respect drop_tokens_threshold even when that token does not exist in the index. 2018-04-13 16:52:51 +05:30
Kishore Nallan
874b5beb89 Fix initialization of priority queue. 2018-04-12 20:56:44 +05:30
Kishore Nallan
6ad5e36179 Allow configuring a threshold for dropping tokens.
Fixes https://github.com/typesense/typesense/issues/20
2018-04-12 19:25:59 +05:30
Kishore Nallan
e43a101c50 If no sort_by fields are provided, sort descending on default_sorting_field. 2018-02-24 12:53:52 +05:30
Kishore Nallan
ca2c084d86 Rename token_ranking_field to default_sorting_field and make it mandatory. 2018-02-24 12:18:48 +05:30
Kishore Nallan
6b37d43fd7 Use a proper logger for logging! 2018-02-02 08:22:23 -05:00
Kishore Nallan
c16513005b Return 409 status code when document with given ID already exists. 2018-01-27 08:47:28 -05:00
Kishore Nallan
85f9887a2f Fixed a bug where a document with a duplicate ID was being inserted without an error. 2018-01-26 21:55:59 +00:00
Kishore Nallan
c3298ba6d8 Address -Wall and -Wextra warnings. 2018-01-25 20:08:13 +05:30
Kishore Nallan
491de5a325 Remove ascii special characters during string normalization.
Unicode special chars are retained verbatim - will be addressed in future.
2018-01-16 21:16:24 +05:30
Kishore Nallan
192b00e71f Address API review comments.
1. Move document specific actions under /documents
2. Document creation echoes the full document
3. Collections summary returns full detail on each each collection
4. Collections summary endpoint has no nested root attribute
5. When collection or document is deleted, the whole entity is returned in response
2018-01-02 21:35:24 +05:30
Kishore Nallan
01275c38f2 Use unorderd_map for low-volume meta datastructures.
Order of spp:sparse_hash_map during iteration is different in clang and gcc.
2017-12-20 09:16:15 +05:30
Kishore Nallan
8d5f7c18a3 Fix a couple of test compile warnings. 2017-12-17 21:42:45 +05:30
Kishore Nallan
fe0db59877 Support indexing of bool fields. 2017-12-13 20:24:44 +05:30
Kishore Nallan
78b9ee52ec Make match score computation predictable and consistent across multiple indexes. 2017-11-12 22:31:29 +05:30
Kishore Nallan
c1c7d493e5 Allow an integer to be passed to a field defined as a float.
In the real world, this is common and it's better to be practical here.
2017-11-05 10:45:45 +05:30
Kishore Nallan
a7479171b1 Limit number of prefix candidates to a constant.
Using number of results for comparison results in change of total count during pagination.
2017-11-02 18:04:55 +05:30
Kishore Nallan
93430444d0 Prefix sort field can also be a float 2017-10-25 18:18:07 +05:30
Kishore Nallan
a2ce56fd67 Allow string fields to be filtered on.
A rather convenient feature to have - but it would be a match of all tokens without typo tolerance.
2017-10-22 19:52:09 +05:30
Kishore Nallan
0e4517d901 Combine search, facet and sort fields into a single "fields".
1. All numerical fields are added to sort index automatically since that makes logical sense.
2. Search fields to be used as a facet are to have a `facet: true` property - removes duplication.
3. If someone wants to use a faceted field also to search against (rare scenario), then they can duplicate that field without the `facet: true` property.
2017-10-17 21:51:07 +05:30
Kishore Nallan
bb3ca4211a Test for pagination. 2017-09-24 22:00:57 +05:30
Kishore Nallan
b3689e16aa Improve test harness to cover some missing cases. 2017-09-23 21:21:13 +05:30
Kishore Nallan
b0cb3ceb41 Set a ceiling on num_typos so that 1 and 2 char prefix searches make sense. 2017-09-22 20:59:26 +05:30
Kishore Nallan
901626652a Make type definitions less verbose.
Use string[] instead of STRING_ARRAY and so on.
2017-09-19 22:01:08 +05:30
Kishore Nallan
d351523655 Allow results to be sorted on a float field. 2017-08-20 21:15:48 +05:30
Kishore Nallan
ea550f167c For prefix search, only the last term in the query should be considered as prefix. 2017-08-19 10:42:49 +05:30
Kishore Nallan
f5848be750 Address prefix search issues.
Score based comparison was broken - test has been enhanced.
2017-08-18 23:17:28 +05:30
Kishore Nallan
38fbbea71f Ensure that the token ranking field is an unsigned int. 2017-08-10 18:29:59 -04:00
Kishore Nallan
e384b777a1 Collection operations on float fields. 2017-08-10 18:20:58 -04:00
Kishore Nallan
916aaf6526 API for fetching a document ID and listing all collections. 2017-07-28 20:39:51 +05:30
Kishore Nallan
ffba0371b0 Proper API responses when pagination exceeds result boundaries. 2017-07-07 18:36:56 +05:30
Kishore Nallan
c471cd50c3 Implement authentication against an API auth key.
The key should be passed via X-API-KEY HTTP header.
2017-07-04 22:18:47 +05:30