SearchSpec.Builder

public static final class SearchSpec.Builder
extends Object

java.lang.Object
   ↳ androidx.appsearch.app.SearchSpec.Builder


Builder for objects.

Summary

Public constructors

Builder()

Public methods

SearchSpec.Builder addFilterDocumentClasses(Class...<?> documentClasses)

Adds the Schema names of given document classes to the Schema type filter of SearchSpec Entry.

SearchSpec.Builder addFilterDocumentClasses(Collection<? extends Class<?>> documentClasses)

Adds the Schema names of given document classes to the Schema type filter of SearchSpec Entry.

SearchSpec.Builder addFilterNamespaces(String... namespaces)

Adds a namespace filter to SearchSpec Entry.

SearchSpec.Builder addFilterNamespaces(Collection<String> namespaces)

Adds a namespace filter to SearchSpec Entry.

SearchSpec.Builder addFilterPackageNames(String... packageNames)

Adds a package name filter to SearchSpec Entry.

SearchSpec.Builder addFilterPackageNames(Collection<String> packageNames)

Adds a package name filter to SearchSpec Entry.

SearchSpec.Builder addFilterSchemas(Collection<String> schemas)

Adds a Schema type filter to SearchSpec Entry.

SearchSpec.Builder addFilterSchemas(String... schemas)

Adds a Schema type filter to SearchSpec Entry.

SearchSpec.Builder addProjection(String schema, Collection<String> propertyPaths)

Adds property paths for the specified type to be used for projection.

SearchSpec build()

Constructs a new SearchSpec from the contents of this builder.

SearchSpec.Builder setMaxSnippetSize(int maxSnippetSize)

Sets maxSnippetSize, the maximum snippet size.

SearchSpec.Builder setOrder(int order)

Indicates the order of returned search results, the default is SearchSpec.ORDER_DESCENDING, meaning that results with higher scores come first.

Search