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
Stat Facet
#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
Data Export and Import
Zulia provides two pairs of tools for getting data in and out of indexes:
| Tool Pair | Use Case |
|---|---|
zuliaexport / zuliaimport |
Data-only export and import. The index must already exist for import. |
zuliadump / zuliarestore |
Full backup and restore including index settings and optional associated files. |
All four tools share these connection options:
--address, --server Zulia Server Address (default: localhost, env: ZULIA_HOST)
--port Zulia Port (default: 32191, env: ZULIA_PORT)
--routing Use smart routing (do not use with SSH port forwarding)
--showStack Show full stack trace on failure
zuliaexport
Exports documents from one or more indexes as JSONL (one JSON document per line). Does not export index settings or associated files.
Options
-i, --index, --indexes Index name(s), repeatable, wildcards allowed (required)
-o, --out Output directory (default: current directory)
-q, --query Zulia query to filter documents (default: *:*)
-p, --pageSize, --rows Page size for streaming (default: 1000)
Output Structure
<out>/zuliaexport/<index-name>/<index-name>.json
Examples
# export all documents from an index
zuliaexport --index publications
# export to a specific directory
zuliaexport --index publications --out /backup/data
# export only matching documents
zuliaexport --index publications --query "pubYear:[2020 TO *]"
# export multiple indexes with wildcard
zuliaexport --index "pub*" --out /backup/data
# export multiple indexes explicitly
zuliaexport --index publications --index news --out /backup/data
zuliaimport
Imports JSONL documents (produced by zuliaexport) into an existing index. The index must already be created before importing.
Options
-i, --index Target index name (required)
--dir Path to the zuliaexport directory (required)
--idField Document ID field name (default: "id")
--threads Number of indexing threads (default: 4)
Examples
# basic import
zuliaimport --dir /backup/data/zuliaexport --index publications
# custom ID field
zuliaimport --dir /backup/data/zuliaexport --index publications --idField docId
# more threads for faster import
zuliaimport --dir /backup/data/zuliaexport --index publications --threads 8
zuliadump
Full backup of one or more indexes including index settings, documents, and optionally associated files.
Options
-i, --index, --indexes Index name(s), repeatable, wildcards allowed (required)
-o, --out Output directory (default: current directory)
-q, --query Zulia query to filter documents (default: *:*)
-p, --pageSize, --rows Page size for streaming (default: 1000)
-a, --includeAssociatedDocs Include associated documents as ZIP archives
Output Structure
<out>/zuliadump/<index-name>/
├── <index-name>.json # Documents (JSONL)
├── <index-name>_settings.json # Index configuration
├── <doc-id>.zip # Associated files (if -a flag used)
└── ...
Examples
# dump an index (documents + settings)
zuliadump --index publications --out /backup
# dump with associated files (full backup)
zuliadump --index publications -a --out /backup
# dump multiple indexes with wildcard
zuliadump --index "pub*" --out /backup
# dump only matching documents
zuliadump --index publications --query "status:published" --out /backup
zuliarestore
Restores indexes from a zuliadump backup. Recreates the index with the original settings before importing documents.
Options
-i, --index, --indexes Index name(s) to restore (optional; restores all if omitted)
--dir Path to the zuliadump directory (required)
--idField Document ID field name (default: "id")
--drop Drop existing index before restoring
--threads Number of indexing threads (default: 4)
-a, --associatedFilesHandling How to handle associated files: skip (default), skipExisting, overwrite
Examples
# restore a single index
zuliarestore --dir /backup/zuliadump --index publications
# restore all indexes in the dump directory
zuliarestore --dir /backup/zuliadump
# drop and recreate index before restoring
zuliarestore --dir /backup/zuliadump --index publications --drop
# restore with associated files
zuliarestore --dir /backup/zuliadump --index publications -a overwrite
# skip associated files that already exist
zuliarestore --dir /backup/zuliadump --index publications -a skipExisting
# faster restore with more threads
zuliarestore --dir /backup/zuliadump --index publications --threads 8
Export/Import vs Dump/Restore
| zuliaexport / zuliaimport | zuliadump / zuliarestore | |
|---|---|---|
| Index settings | Not included. Index must exist before import. | Included. Index is recreated on restore. |
| Associated files | Not supported | Optional (-a flag) |
| Use case | Moving data between existing indexes | Full backup and disaster recovery |
| Index selection | Export: multiple indexes. Import: single index. | Both support multiple indexes and wildcards. |