GroupDocs.Search allows creating a full-text index or a metadata index of documents. To index only metadata without the main content of documents, set the index_type property of the index settings to IndexType.METADATA_INDEX when creating an index. The size of an index of this type will be very small. The index type is fixed when the index is created, so it cannot be changed for an existing index.
The following example demonstrates the creation of the metadata index.
fromgroupdocs.searchimportIndex,IndexSettingsfromgroupdocs.search.optionsimportIndexType# Creating an instance of index settingssettings=IndexSettings()settings.index_type=IndexType.METADATA_INDEX# Setting index type# Creating a new index in the specified folderindex=Index("./index",settings,True)# Indexing documents from the specified folderindex.add("./documents")# Searching in the indexresult=index.search("Einstein")print("Documents found:",result.document_count)
Along with the full-featured library, we provide a free online document search app. You are welcome to search over your PDF, DOC, DOCX, PPT, PPTX, XLS, XLSX and more with our Free Online Document Search App.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.