Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modules/n1ql/pages/n1ql-language-reference/searchfun.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
= Search Functions
:description: Search functions enable you to use Full Text Search (FTS) queries directly within a {sqlpp} query.
:page-topic-type: reference
:page-aliases: fts:fts-searching-from-N1QL.adoc
:example-caption!:
:imagesdir: ../../assets/images
:underscore: _
Expand Down
3 changes: 2 additions & 1 deletion modules/search/examples/geospatial-search-index.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"include_in_all": true,
"index": true,
"name": "$FIELD_NAME",
"type": "geopoint"
//Replace with "geoshape" if your field contains GeoJSON data, instead.
"type": "geopoint"
}
]
}
Expand Down
37 changes: 37 additions & 0 deletions modules/search/examples/geospatial-search-query-geojson.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
curl -s -XPUT -H "Content-Type: application/json" \
-u ${CB_USERNAME}:${CB_PASSWORD} http://${CB_HOSTNAME}:8094/api/bucket/${BUCKET-NAME}/scope/${SCOPE-NAME}/index/${INDEX-NAME}/query
-d '{
"query": {
"field": "geojson",
"geometry": {
"shape": {
"type": "Polygon",
"coordinates": [
[
[
0.47482593026924746,
51.31232878073189
],
[
0.6143265647863245,
51.31232878073189
],
[
0.6143265647863245,
51.384000374770466
],
[
0.47482593026924746,
51.384000374770466
],
[
0.47482593026924746,
51.31232878073189
]
]
]
},
"relation": "within"
}
}
}
23 changes: 0 additions & 23 deletions modules/search/examples/geospatial-search-query.jsonc

This file was deleted.

25 changes: 25 additions & 0 deletions modules/search/examples/geospatial-search-query.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
curl -s -XPUT -H "Content-Type: application/json" \
-u ${CB_USERNAME}:${CB_PASSWORD} http://${CB_HOSTNAME}:8094/api/bucket/${BUCKET-NAME}/scope/${SCOPE-NAME}/index/${INDEX-NAME}/query
-d '{
"from": 0,
"size": 10,
"query": {
"location": {
"lon": -2.235143,
"lat": 53.482358
},
"distance": "100mi",
"field": "geo"
},
"sort": [
{
"by": "geo_distance",
"field": "geo",
"unit": "mi",
"location": {
"lon": -2.235143,
"lat": 53.482358
}
}
]
}'
7 changes: 5 additions & 2 deletions modules/search/pages/child-field-options-reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,17 @@ If you remove the child field from the index, it cannot appear in search results
|[[store]]Store a|

To store the values from the field in the index and return them in search results, select *Store*.
This increases your index's size and indexing time.
This increases your index's size and indexing time.

You can return the values from this field when you include xref:search-request-params.adoc#fields[the fields array] in a Search query.

To remove the field's values from the index, clear *Store*.

|Include in _all field a|

The `_all` field is a composite field that has the content from multiple fields in an index.
It allows searches to query the content of a field without specifying the field's name.
It allows searches to query the content of a field without specifying the field's name.
This option increases your index's size.

To include this field in the `_all` field, select *Include in _all field*.

Expand Down
4 changes: 3 additions & 1 deletion modules/search/pages/create-child-field.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ To add or remove a child field from a Search index with the Couchbase {page-ui-n
. Click *insert child field*.
. [[field]]In the *Field* field, enter the name of a field in your documents that you want to add or remove from the index.
+
NOTE: The field must contain either a single value or an array. If the field contains a JSON object, xref:create-child-mapping.adoc[create a child mapping] instead.
NOTE: The field must contain either a single value or an array.
If the field contains a JSON object, xref:create-child-mapping.adoc[create a child mapping] instead.
Field names must not contain periods (`.`).
. In the *Type* list, select the data type for the field.
+
For more information about the available data types, see xref:field-data-types-reference.adoc[].
Expand Down
2 changes: 2 additions & 0 deletions modules/search/pages/create-custom-analyzer.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
:page-topic-type: guide
:page-ui-name: {ui-name}
:page-product-name: {product-name}
:page-aliases: fts:fts-index-analyzers.adoc
:description: Create a custom analyzer with the Couchbase {page-ui-name} to modify the input text from a Search query or Search index and improve search results.

[abstract]
{description}
For more information about analyzers, see xref:customize-index.adoc#analyzers[].

== Prerequisites

Expand Down
1 change: 1 addition & 0 deletions modules/search/pages/create-custom-date-time-parser.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
:page-topic-type: guide
:page-ui-name: {ui-name}
:page-product-name: {product-name}
:page-aliases: fts:fts-date-time-parsers.adoc
:description: Create a custom date/time parser with the Couchbase {page-ui-name} to tell the Search Service how to process a new date/time format.

[abstract]
Expand Down
7 changes: 6 additions & 1 deletion modules/search/pages/create-quick-index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
:page-topic-type: guide
:page-ui-name: {ui-name}
:page-product-name: {product-name}
:page-aliases: fts:fts-creating-index-from-UI-quick-editor.adoc
:description: Use the Quick Index editor in the Couchbase {page-ui-name} to create a Search index.

[abstract]
Expand Down Expand Up @@ -45,6 +46,9 @@ You cannot have 2 indexes with the same name inside the same bucket and scope.
. In the second *Keyspace* list, select the scope where you want to create the index.
. In the third *Keyspace* list, select the collection where you want to create the index.
. In the *Select Fields* box, click a field in the document that you want to add to the index.
+
TIP: You can randomly select a new document from your chosen keyspace by clicking btn:[Refresh] above the *Select Fields* display.

. In the *Type* list, select the field's data type.
+
For more information about the available data types, see xref:field-data-types-reference.adoc[].
Expand All @@ -61,4 +65,5 @@ You can xref:customize-index.adoc[customize your index] with the standard Search

CAUTION: If you edit your Search index with the xref:create-search-index-ui.adoc[standard editor], you cannot return to Quick Mode and keep any advanced settings.

To run a search and test the contents of your Search index, see xref:simple-search-ui.adoc[] or xref:simple-search-rest-api.adoc[].
To run a search and test the contents of your Search index, see xref:simple-search-ui.adoc[] or xref:simple-search-rest-api.adoc[].
You can run a search before *Indexing progress* reaches 100% and return partial results.
6 changes: 5 additions & 1 deletion modules/search/pages/create-search-index-rest-api.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
:page-topic-type: guide
:page-ui-name: {ui-name}
:page-product-name: {product-name}
:page-aliases: fts:fts-creating-index-from-REST-onefield.adoc, fts:fts-creating-index-from-REST-dynamic.adoc, fts:fts-creating-index-from-REST-legacy.adoc
:description: You can create a Search index with the Search Service API.

[abstract]
Expand Down Expand Up @@ -37,11 +38,14 @@ To create a Search index with the REST API:
include::example$create-search-index-header.sh[]
----
+
To use SSL, use the `https` protocol in the Search Service endpoint URL and port `18094`.
+
[NOTE]
====
Your index name must start with an alphabetic character (a-z or A-Z). It can only contain alphanumeric characters (a-z, A-Z, or 0-9), hyphens (-), or underscores (_).

For Couchbase Server version 7.6 and later, your index name must be unique inside your selected bucket and scope. You cannot have 2 indexes with the same name inside the same bucket and scope.
For Couchbase Server version 7.6 and later, your index name must be unique inside your selected bucket and scope.
You cannot have 2 indexes with the same name inside the same bucket and scope.
====

. Enter the JSON payload for the settings you want in your index.
Expand Down
7 changes: 5 additions & 2 deletions modules/search/pages/create-search-index-ui.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
:page-topic-type: guide
:page-ui-name: {ui-name}
:page-product-name: {product-name}
:page-aliases: fts:fts-creating-index-from-UI-classic-editor.adoc, fts:fts-creating-index-from-UI-classic-editor-dynamic.adoc, fts:fts-creating-index-from-UI-classic-editor-legacy.adoc, fts:fts-manage-index-lifecycle.adoc
:description: You can create a Search index with the Couchbase {page-ui-name}.

[abstract]
Expand Down Expand Up @@ -37,7 +38,8 @@ To create a Search index with the Couchbase {page-ui-name}:
====
Your index name must start with an alphabetic character (a-z or A-Z). It can only contain alphanumeric characters (a-z, A-Z, or 0-9), hyphens (-), or underscores (_).

For Couchbase Server version 7.6 and later, your index name must be unique inside your selected bucket and scope. You cannot have 2 indexes with the same name inside the same bucket and scope.
For Couchbase Server version 7.6 and later, your index name must be unique inside your selected bucket and scope.
You cannot have 2 indexes with the same name inside the same bucket and scope.
====

. In the *Bucket* list, select the bucket where you want to create the index.
Expand All @@ -53,4 +55,5 @@ You can run a search against this index, but it's recommended that you customize

For more information about how to customize an index, see xref:customize-index.adoc[].

For more information about how to run a search, see xref:simple-search-ui.adoc[] or xref:simple-search-rest-api.adoc[].
For more information about how to run a search, see xref:simple-search-ui.adoc[] or xref:simple-search-rest-api.adoc[].
You can run a search before *Indexing progress* reaches 100% and return partial results.
7 changes: 7 additions & 0 deletions modules/search/pages/create-search-indexes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
:page-topic-type: concept
:page-ui-name: {ui-name}
:page-product-name: {product-name}
:page-aliases: fts:fts-quickstart-guide.adoc, fts:fts-creating-indexes.adoc, fts:fts-creating-index-with-rest-api.adoc, fts:fts-creating-index-from-UI-difference-between-classic-quick-editor.adoc
:description: Create a Search index to get started with the Search Service in your database.

[abstract]
Expand All @@ -23,6 +24,9 @@ To xref:create-search-index-ui.adoc[create a basic Search index], provide the fo
* The name of the index.
* The bucket where you want to create the index.

Many of the examples in the Search Service documentation use the `travel-sample` sample data bucket.
For more information about how to load this sample data on your own database, see xref:manage:manage-settings/install-sample-buckets.adoc[].

[NOTE]
====
For indexes created with Couchbase Server version 7.6 and later, index names must be unique inside a bucket and scope.
Expand Down Expand Up @@ -53,6 +57,9 @@ The Web Console also has a Quick Index editor.

You can use the Quick Index editor to create a Search index by selecting fields from a document from your database.

The Quick Index editor works best when you need to create a basic Search index to start testing and prototyping with the Search Service.
If you want to have greater control over how the Search Service returns results, such as changing your xref:customize-index.adoc#analyzers[analyzer], use xref:create-search-index-ui.adoc[the standard editor].

You can edit an index that you created with the Quick Index editor in the standard editor later.
You cannot edit an index that you created with the standard editor in the Quick Index editor.

Expand Down
6 changes: 5 additions & 1 deletion modules/search/pages/create-type-mapping.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
:page-topic-type: guide
:page-ui-name: {ui-name}
:page-product-name: {product-name}
:page-aliases: fts:fts-type-mappings.adoc
:description: Create a type mapping with the Couchbase {page-ui-name} to control what documents are included or excluded from a Search index.

[abstract]
Expand Down Expand Up @@ -39,7 +40,10 @@ For more information, see xref:set-type-identifier.adoc[].
You can xref:default-analyzers-reference.adoc[use a default analyzer] or xref:create-custom-analyzer.adoc[create your own].
. (Optional) To switch from a xref:customize-index.adoc#type-mappings[dynamic type mapping to a static type mapping], select *Only index specified fields*.
.. To choose which fields to add or remove from the static type mapping, see xref:create-child-field.adoc[].
.. To add a child type mapping for a document field that contains a JSON object, see xref:create-child-mapping.adoc[].
.. To add a child mapping for a document field that contains a JSON object, see xref:create-child-mapping.adoc[].
. (Optional) To remove all documents that match the type mapping from your Search index, clear the checkbox for that type mapping.
+
By leaving the checkbox selected, all matching documents will be included in the Search index.
. Click btn:[OK].

== Next Steps
Expand Down
1 change: 1 addition & 0 deletions modules/search/pages/customize-index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
:page-topic-type: concept
:page-ui-name: {ui-name}
:page-product-name: {product-name}
:page-aliases: fts:fts-configure-index-options.adoc, fts:fts-custom-filters.adoc
:description: Configure additional options for a Search index to improve performance and fine tune your search results.

[abstract]
Expand Down
4 changes: 2 additions & 2 deletions modules/search/pages/field-data-types-reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ It does not contain any alphabetic characters.
|disabled | This field data type is deprecated.
It's included for compatibility only.

|geopoint a|
|[[geopoint]]geopoint a|

The field contains geopoint (latitude and longitude) data, represented as either:

Expand All @@ -40,7 +40,7 @@ The field contains geopoint (latitude and longitude) data, represented as either
* An array, as two floating point integers.
* A JSON object, with the properties `lon`/`lng` and `lat`.

|geoshape a|
|[[geoshape]]geoshape a|

The field contains a GeoJSON object.

Expand Down
22 changes: 17 additions & 5 deletions modules/search/pages/geo-search-rest-api.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
:page-topic-type: guide
:page-ui-name: {ui-name}
:page-product-name: {product-name}
:page-aliases: fts:fts-creating-index-from-REST-geopoint.adoc, fts:fts-creating-index-from-REST-geojson.adoc
:description: Search for geospatial data in your Couchbase {page-product-name} database with a compatible Search index, the REST API and curl/HTTP.

[abstract]
Expand All @@ -16,6 +17,8 @@ For more information about how to deploy a new node and Services on your databas
For more information about how to create a bucket, see xref:server:manage:manage-buckets/create-bucket.adoc[].

* You have documents in your database that contain geospatial data.
+
For more information about the supported data types, see xref:field-data-types-reference.adoc#geopoint[geopoint] or xref:field-data-types-reference.adoc#geoshape[geoshape].

* Your user account has the *Search Admin* role for the bucket where you want to create the Search index.
+
Expand Down Expand Up @@ -61,13 +64,22 @@ include::example$run-search-header.sh[]
To use SSL, use the `https` protocol in the Search Service endpoint URL and port `18094`.
. Enter the JSON payload for your query.

=== Example
=== Example: Geopoint Query

For example, the following query searches a geospatial field, `geo`, for any locations within a 100 mile radius of the coordinates `-2.235143, 53.482358`:
+
[source,json]
For example, the following query searches a geospatial field, `geo`, for any locations within a 100 mile radius of the coordinates `-2.235143, 53.482358` with a xref:search-request-params.adoc#geopoint-queries-distance[Distance/Radius-Based Geopoint Query]:

[source,console]
----
include::example$geospatial-search-query.sh[]
----

=== Example: GeoJSON Query

For example, the following query searches a geospatial field, `geojson`, for any locations within a defined shape with a xref:search-request-params.adoc#geojson-queries-polygon[Polygon GeoJSON Query]:

[source,console]
----
include::example$geospatial-search-query.jsonc[]
include::example$geospatial-search-query-geojson.sh[]
----

== Next Steps
Expand Down
1 change: 1 addition & 0 deletions modules/search/pages/geo-search-ui.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
:page-topic-type: guide
:page-ui-name: {ui-name}
:page-product-name: {product-name}
:page-aliases: fts:fts-creating-index-from-UI-classic-editor-geopoint.adoc
:description: Search for geospatial data in your Couchbase {page-product-name} database with a compatible Search index and the Couchbase {page-ui-name}.

[abstract]
Expand Down
1 change: 1 addition & 0 deletions modules/search/pages/index-aliases.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
:page-topic-type: concept
:page-ui-name: {ui-name}
:page-product-name: {product-name}
:page-aliases: fts:fts-creating-full-text-aliases.adoc
:description: A Search index alias lets you run a Search query against a Search index without using the original Search index name.

[abstract]
Expand Down
1 change: 1 addition & 0 deletions modules/search/pages/run-searches.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
:page-topic-type: concept
:page-ui-name: {ui-name}
:page-product-name: {product-name}
:page-aliases: fts:fts-perform-searches.adoc, fts:fts-searching-full-text-indexes-aliases.adoc, fts:fts-searching-with-sdk.adoc
:description: Run a Search query to search and return the contents of a Search index.

[abstract]
Expand Down
2 changes: 1 addition & 1 deletion modules/search/pages/search-index-params.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The type of index you want to create:

* `fulltext-index`: Create a Search index.
* `fulltext-alias`: Create an alias for a Search index.
For more information about Search index aliases, see xref:server:fts:fts-creating-full-text-aliases.adoc[].
For more information about Search index aliases, see xref:index-aliases.adoc[].

|[[uuid]]uuid |String |No a|

Expand Down
Loading