-
Notifications
You must be signed in to change notification settings - Fork 9
Command Line Client
Matthew Davis edited this page May 31, 2022
·
8 revisions
The zuliaadmin
command supports managing indexes and index aliases in the cluster as well as other function not included in querying or backups/exporting.
All zuliaadmin options can use the following options
--port=<port> Zulia Port
--routing Use smart routing to route request to the correct node
(do not use with ssh port forwarding)
--server, --address=<address>
zuliaadmin displayNodes
zuliaadmin displayNodes --activeOnly
zuliaadmin displayIndexes
# add node location as well in addition to the index name
zuliaadmin displayIndexes --detailed
bash zuliaadmin docCount --index someIndex
bash zuliaadmin docCount --index "some*"
bash zuliaadmin docCount --index someIndex --index someIndex2
bash zuliaadmin docCount --indexes someIndex,someIndex2
bash zuliaadmin clearIndex --index someIndex
bash zuliaadmin clearIndex --index "some*"
bash zuliaadmin clearIndex --index someIndex --index someIndex2
bash zuliaadmin clearIndex --indexes someIndex,someIndex2
bash zuliaadmin deleteIndex --index someIndex
bash zuliaadmin deleteIndex --index "some*"
bash zuliaadmin deleteIndex --index someIndex --index someIndex2
bash zuliaadmin deleteIndex --indexes someIndex,someIndex2
# Also delete associated files
bash zuliaadmin deleteIndex --index someIndex --deleteAssociated
Optimize Index (Merge index to a single segment, only recommended for a not frequently changing index)
bash zuliaadmin optimizeIndex --index someIndex
bash zuliaadmin optimizeIndex --index "some*"
bash zuliaadmin optimizeIndex --index someIndex --index someIndex2
bash zuliaadmin optimizeIndex --indexes someIndex,someIndex2
bash zuliaadmin reindex --index someIndex
bash zuliaadmin reindex --index "some*"
bash zuliaadmin reindex --index someIndex --index someIndex2
bash zuliaadmin reindex --indexes someIndex,someIndex2
# create an index to allow searching index news2020 by the name news
zuliadmin createAlias --alias news --index news2022
zuliaadmin deleteAlias --alias someAlias
zuliaadmin deleteAlias --alias someAlias --alias someAlias2
zuliaadmin deleteAlias --alias "some*"
zuliaadmin displayAliases
zuliaadmin exportAliases -f=myIndexAliases.json --alias myAlias
zuliaadmin exportAliases -f=myIndexAliases.json --alias myAlias,myAlias2
zuliaadmin exportAliases -f=myIndexAliases.json --alias "*"
zuliaadmin importAliases -f=myIndexAliases.json
The zulia
command supports search and faceting from the command line
The zulia server/port can be given the follow options but defaults to localhost and 32191
--port=<port> Zulia Port
--routing Use smart routing to route request to the correct node
(do not use with ssh port forwarding)
--server, --address=<address>
-m, --mm, --minimumShouldMatch=n
How many optional (ORed) terms are required
-o, --defaultOperator=OR,AND
The default operator to use if not explicitly defined
between terms
-q, --query=someQuery
--qf, --queryFields=<arg1>
Fields to search for terms in the query without an
explicit field given
# search title field in publication index for term cancer and return 10 ids/relevance scores
zulia --index publications --rows 10 search --query "title:cancer"
# search title field in publication index for term cancer and return 10 results with title and pubYear
zulia --index publications --rows 10 --fetch FULL --fl title --fl pubYear search --query "title:cancer"
# search title field in publication and news indexes for term cancer and return 10 results with title and pubYear
zulia --index publications --index news --rows 10 --fetch FULL --fl title --fl pubYear search --query "title:cancer"
# search title and abstract field in publication index for term cancer and return 10 results with title and pubYear
zulia --index publications --rows 10 --fetch FULL --fl title --fl pubYear search --query "cancer" --queryField title --queryField abstract
Filters are the same as queries except there is no score calculated
-m, --mm, --minimumShouldMatch=n
How many optional (ORed) terms are required
-o, --defaultOperator=OR,AND
The default operator to use if not explicitly defined
between terms
-q, --query=someQuery
--qf, --queryFields=<arg1>
Fields to search for terms in the query without an
explicit field given
# filter results to where pubYear=2020
zulia --index publications --rows 10 --fetch FULL --fl title --fl pubYear filter --query "pubYear:2020"
# filter results to where pubYear is 2020 AND journalName is Nature
zulia --index publications --rows 10 --fetch FULL --fl title --fl pubYear filter --query "pubYear:2020" filter --query "journalName:Nature"
# filter results to where pubYear is 2020 and title contains cats. The search will be order by the relevance of the search cats
zulia --index publications --rows 10 --fetch FULL --fl title --fl pubYear filter --query "pubYear:2020" search --query "title:cats"
-s, --sortField=fieldToSort Sort field name
-o, --order=ASCENDING,DESCENDING
# filter documents to document matching cats in title and sort the results be title A-Z
zulia --index publications --rows 10 --fetch FULL --fl title --fl pubYear filter --query "title:cats" sort --sortField title --order ASCENDING
# filter documents to document matching cats in title and sort the results be title A-Z
zulia --index publications --rows 10 --fetch FULL --fl title --fl pubYear filter --query "title:cats" sort --sortField title --order ASCENDING
# sort by pubYear descending then by title ascending (A-Z)
zulia --index publications --rows 10 --fetch FULL --fl title --fl pubYear filter --query "title:cats" sort --sortField pubYear --order DESCENDING sort --sortField title --order ASCENDING
-f, --facetField=facetName Facet facet field name
-p, --path=somePath Path values for a hierarchical facet
-s, --shardTopN=n The number of facets to request from each shard.
Increasing this number can increase the accuracy
of sharded facets when all of the facets are not
returned in the top N
-t, --topN=n The number of facets to return
# show top 10 (default) pubYear counts for search title:cats and do not return documents
zulia --index publications search --query "title:cats" facet --facetField pubYear
# same but also return top 15 search result ids (also could be a full fetch)
zulia --index publications --rows 15 search --query "title:cats" facet --facetField pubYear
# show top 20 pubYear counts of search title:cats and do not return documents
zulia --index publications search --query "title:cats" facet --facetField pubYear --top 20
# show number of values, number of documents, min, max, and sum for field pubYear matching the search of title:dogs
zulia --index publications search --query "title:dogs" stat --numericField pubYear
# show number of values, number of documents, min, max, sum for field pubYear and authorCount matching the search of title:dogs
zulia --index publications search --query "title:cats" stat --numericField pubYear stat --numericField authorCount
#show the sum of author count for each facet of pubYear (sorted by authorCount sum)
zulia --index publications search --query "title:cats" statFacet --facetField pubYear --numericField authorCount