CreateSearchIndex
CreateSearchIndex[dir]
creates a search index from all files in the directory dir and its subdirectories.
CreateSearchIndex[{source1,source2,…}]
creates a search index from all sources sourcei.
CreateSearchIndex[sources,"name"]
gives the search index the specified name.
creates an empty search index, which can be added to with AddToSearchIndex.
Details and Options
- CreateSearchIndex yields a SearchIndexObject.
- Possible sources used in CreateSearchIndex include:
-
"file" or File[…] individual file "dir" or File[…] directory of files ContentObject[…] content with metadata {obj1,obj2,…} list of indexable objects - SearchIndices[] gives the list of search indices created by CreateSearchIndex.
- CreateSearchIndex has the following options:
-
ContentFieldOptions Automatic options for handling fields in the content ContentLocationFunction Automatic function to determine how to locate content DocumentWeightingRules None weighting of documents based on the values of certain fields Language Automatic what language to assume text is in Method Automatic what indexing method to use OverwriteTarget False whether to allow overwriting an existing index - Possible settings for Method include "BM25" and "TFIDF".
Examples
open allclose allBasic Examples (2)
Create a search index from two files:
TextSearch searches in the index:
Create a search index from all files and subfolders in a folder:
Text
Wolfram Research (2015), CreateSearchIndex, Wolfram Language function, https://reference.wolfram.com/language/ref/CreateSearchIndex.html (updated 2019).
CMS
Wolfram Language. 2015. "CreateSearchIndex." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2019. https://reference.wolfram.com/language/ref/CreateSearchIndex.html.
APA
Wolfram Language. (2015). CreateSearchIndex. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CreateSearchIndex.html