Command Line Tools
Zulia Admin
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>
Cluster Nodes
Display Cluster Nodes
zuliaadmin displayNodes
Display Active Cluster Nodes
zuliaadmin displayNodes --activeOnly
Index Management
Display Indexes
zuliaadmin displayIndexes
# add node location as well in addition to the index name
zuliaadmin displayIndexes --detailed
Display Doc Count for Index(es)
bash zuliaadmin docCount --index someIndex
bash zuliaadmin docCount --index "some*"
bash zuliaadmin docCount --index someIndex --index someIndex2
bash zuliaadmin docCount --indexes someIndex,someIndex2
Clear Index (Remove documents without deleting the index)
bash zuliaadmin clearIndex --index someIndex
bash zuliaadmin clearIndex --index "some*"
bash zuliaadmin clearIndex --index someIndex --index someIndex2
bash zuliaadmin clearIndex --indexes someIndex,someIndex2
Delete Index (Remove documents without deleting the index)
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
Reindex (In place reindex of content)
bash zuliaadmin reindex --index someIndex
bash zuliaadmin reindex --index "some*"
bash zuliaadmin reindex --index someIndex --index someIndex2
bash zuliaadmin reindex --indexes someIndex,someIndex2
Index Alias Management
Create index alias
# create an index to allow searching index news2020 by the name news
zuliadmin createAlias --alias news --index news2022
Delete index alias
zuliaadmin deleteAlias --alias someAlias
zuliaadmin deleteAlias --alias someAlias --alias someAlias2
zuliaadmin deleteAlias --alias "some*"
Display index aliases
zuliaadmin displayAliases
Export index aliases
zuliaadmin exportAliases -f=myIndexAliases.json --alias myAlias
zuliaadmin exportAliases -f=myIndexAliases.json --alias myAlias,myAlias2
zuliaadmin exportAliases -f=myIndexAliases.json --alias "*"
Import index aliases (expects format of export index aliases)
zuliaadmin importAliases -f=myIndexAliases.json
Zulia Searching / Faceting
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>
Search
Search Options
-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
Basic Search (Ids and Scores Only)
# search title field in publication index for term cancer and return 10 ids/relevance scores
zulia --index publications --rows 10 search --query "title:cancer"
Basic Search (Return a few fields)
# 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"
Multiple Indexes
# 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"
Query Fields
# 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
Filter
Filters are the same as queries except there is no score calculated
Filter Options
-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
Single Filter
# filter results to where pubYear=2020
zulia --index publications --rows 10 --fetch FULL --fl title --fl pubYear filter --query "pubYear:2020"
Multiple Filters
# 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 With Search (Scored Query)
# 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"
Sort
Sort Options
-s, --sortField=fieldToSort Sort field name
-o, --order=ASCENDING,DESCENDING
Basic Sort
# 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
Basic Sort
# 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
Two Sorts
# 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
Facet / Aggregation
Facet Options
-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
Simple Facet
# 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
Numeric Stat
# 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
Numeric Stat
#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