Skip to content

Commit

Permalink
Merge branch 'master' into update-buddy-version
Browse files Browse the repository at this point in the history
  • Loading branch information
sanikolaev authored Dec 13, 2024
2 parents a5a5ce5 + 89c9301 commit 272dcf6
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Manticore Search was forked from [Sphinx 2.3.2](https://github.com/sphinxsearch/
- [Sync from CSV](https://manual.manticoresearch.com/Adding_data_from_external_storages/Fetching_from_CSV,TSV#Fetching-from-TSV,CSV)
- [With MySQL as a storage engine](https://manual.manticoresearch.com/Extensions/SphinxSE#Using-SphinxSE)
- [With MySQL via FEDERATED engine](https://manual.manticoresearch.com/Extensions/FEDERATED)
- [ProxySQL](https://manticoresearch.com/2018/06/18/using-proxysql-to-route-inserts-in-a-distributed-realtime-index/)
- [ProxySQL](https://manticoresearch.com/blog/using-proxysql-to-route-inserts-in-a-distributed-realtime-index/)
- [Apache Superset](https://manticoresearch.com/blog/manticoresearch-apache-superset-integration/)
- [Grafana](https://manticoresearch.com/blog/manticoresearch-grafana-integration/)
- [Fluentbit](https://manticoresearch.com/blog/integration-of-manticore-with-fluentbit/)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -499,17 +499,18 @@ var sqlresult = indexApi.Insert(newdoc);
```
<!-- end -->

<!-- example call -->
### UUID_SHORT multi-ID generation

```sql
CALL UUID_SHORT(N)
```

`CALL UUID_SHORT(N)` statement allows for generating N unique 64-bit IDs in a single call. It is designed for batch operations, where efficiently obtaining multiple unique IDs is essential.
The `CALL UUID_SHORT(N)` statement allows for generating N unique 64-bit IDs in a single call without inserting any documents. It is particularly useful when you need to pre-generate IDs in Manticore for use in other systems or storage solutions. For example, you can generate auto-IDs in Manticore and then use them in another database, application, or workflow, ensuring consistent and unique identifiers across different environments.

<!-- intro -->
##### SQL:
<!-- request SQL -->
##### Example:
<!-- request Example -->

```sql
CALL UUID_SHORT(3)
Expand All @@ -536,6 +537,19 @@ You can insert not just a single document into a real-time table, but as many as

Note that the `/bulk` HTTP endpoint does not support automatic creation of tables (auto schema). Only the `/_bulk` (Elasticsearch-like) HTTP endpoint and the SQL interface support this feature. The `/_bulk` (Elasticsearch-like) HTTP endpoint allows the table name to include the cluster name in the format `cluster_name:table_name`.

`/_bulk` endpoint accepts document IDs in the same format as Elasticsearch, and you can also include the `id` within the document itself:
```json
{ "index": { "_index" : "products", "_id" : "1" } }
{ "title" : "Crossbody Bag with Tassel", "price": 19.85 }
```

or

```json
{ "index": { "_index" : "products" } }
{ "title" : "Crossbody Bag with Tassel", "price": 19.85, "id": "1" }
```

#### Chunked transfer in /bulk
The `/bulk` (Manticore mode) endpoint supports [Chunked transfer encoding](https://en.wikipedia.org/wiki/Chunked_transfer_encoding). You can use it to transmit large batches. It:
* reduces peak RAM usage, lowering the risk of OOM
Expand Down Expand Up @@ -771,7 +785,7 @@ res = await indexApi.bulk(docs.map(e=>JSON.stringify(e)).join('\n'));
``` java
String body = "{\"insert\": {\"index\" : \"products\", \"id\" : 1, \"doc\" : {\"title\" : \"Crossbody Bag with Tassel\", \"price\" : 19.85}}}"+"\n"+
"{\"insert\": {\"index\" : \"products\", \"id\" : 4, \"doc\" : {\"title\" : \"microfiber sheet set\", \"price\" : 19.99}}}"+"\n"+
"{\"insert\": {\"index\" : \"products\", \"id\" : 5, \"doc\" : {\"title\" : \"CPet Hair Remover Glove\", \"price\" : 7.99}}}"+"\n";
"{\"insert\": {\"index\" : \"products\", \"id\" : 5, \"doc\" : {\"title\" : \"CPet Hair Remover Glove\", \"price\" : 7.99}}}"+"\n";
BulkResponse bulkresult = indexApi.bulk(body);
```

Expand All @@ -783,7 +797,7 @@ BulkResponse bulkresult = indexApi.bulk(body);
``` clike
string body = "{\"insert\": {\"index\" : \"products\", \"id\" : 1, \"doc\" : {\"title\" : \"Crossbody Bag with Tassel\", \"price\" : 19.85}}}"+"\n"+
"{\"insert\": {\"index\" : \"products\", \"id\" : 4, \"doc\" : {\"title\" : \"microfiber sheet set\", \"price\" : 19.99}}}"+"\n"+
"{\"insert\": {\"index\" : \"products\", \"id\" : 5, \"doc\" : {\"title\" : \"CPet Hair Remover Glove\", \"price\" : 7.99}}}"+"\n";
"{\"insert\": {\"index\" : \"products\", \"id\" : 5, \"doc\" : {\"title\" : \"CPet Hair Remover Glove\", \"price\" : 7.99}}}"+"\n";
BulkResponse bulkresult = indexApi.Bulk(string.Join("\n", docs));
```

Expand Down
2 changes: 1 addition & 1 deletion manual/Introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Manticore is equipped with an external tool [manticore-backup](Securing_and_comp
The `indexer` tool and comprehensive configuration syntax of Manticore make it easy to sync data from sources like MySQL, PostgreSQL, ODBC-compatible databases, XML, and CSV.

#### Integration options
You can integrate Manticore Search with a MySQL/MariaDB server using the [FEDERATED engine](Extensions/FEDERATED.md) or via [ProxySQL](https://manticoresearch.com/2018/06/18/using-proxysql-to-route-inserts-in-a-distributed-realtime-index/).
You can integrate Manticore Search with a MySQL/MariaDB server using the [FEDERATED engine](Extensions/FEDERATED.md) or via [ProxySQL](https://manticoresearch.com/blog/using-proxysql-to-route-inserts-in-a-distributed-realtime-index/).

You can use [Apache Superset](https://manticoresearch.com/blog/manticoresearch-apache-superset-integration/) and [Grafana](https://manticoresearch.com/blog/manticoresearch-grafana-integration/) to visualize data stored in Manticore. Various MySQL tools can be used to develop Manticore queries interactively, such as [HeidiSQL](https://www.heidisql.com/) and [DBForge](https://www.devart.com/dbforge/).

Expand Down
2 changes: 1 addition & 1 deletion manual/Searching/Autocomplete.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ To autocomplete a sentence, you can use [infixed search](../Creating_a_table/NLP
* optionally using `""` for phrase matching
* and using [result highlighting](../Searching/Highlighting.md)

There is an [article about it in our blog](https://manticoresearch.com/2020/03/31/simple-autocomplete-with-manticore/) and an [interactive course](https://play.manticoresearch.com/simpleautocomplete/). A quick example is:
There is an [article about it in our blog](https://manticoresearch.com/blog/simple-autocomplete-with-manticore/) and an [interactive course](https://play.manticoresearch.com/simpleautocomplete/). A quick example is:
* Let's assume you have a document: `My cat loves my dog. The cat (Felis catus) is a domestic species of small carnivorous mammal.`
* Then you can use `^`, `""`, and `*` so as the user is typing, you make queries like: `^"m*"`, `^"my *"`, `^"my c*"`, `^"my ca*"` and so on
* It will find the document, and if you also do [highlighting](../Searching/Highlighting.md), you will get something like: `<b>My cat</b> loves my dog. The cat ( ...`
Expand Down
7 changes: 4 additions & 3 deletions src/searchdhttp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -646,8 +646,9 @@ void HttpRequestParser_c::ParseList ( Str_t sData, OptionsHash_t & hOptions )
{
HTTPINFO << "ParseList with " << sData.second << " bytes '" << Data2Log ( sData ) << "'";

const char * sCur = sData.first;
const char* sLast = sCur;
CSphString sBuf ( sData );
const char * sCur = sBuf.cstr();
const char * sLast = sCur;
const char * sEnd = sCur + sData.second;

Str_t sName = dEmptyStr;
Expand Down Expand Up @@ -727,7 +728,7 @@ inline void HttpRequestParser_c::FinishParserUrl ()
if ( ( tUri.field_set & uQuery )!=0 )
{
Str_t sRawGetQuery { sData.first + tUri.field_data[UF_QUERY].off, tUri.field_data[UF_QUERY].len };
if ( m_eType == HTTP_GET )
if ( m_eType==HTTP_GET )
DecodeAndStoreRawQuery ( m_hOptions, sRawGetQuery );
ParseList ( sRawGetQuery, m_hOptions );
}
Expand Down

0 comments on commit 272dcf6

Please sign in to comment.