Gets the flag of case sensitive search. The default value is false .
Returns:
boolean - The flag of case sensitive search.
setUseCaseSensitiveSearch(boolean value)
public void setUseCaseSensitiveSearch(boolean value)
Sets the flag of case sensitive search. The default value is false .
Parameters:
Parameter
Type
Description
value
boolean
The flag of case sensitive search.
getMaxTotalOccurrenceCount()
public int getMaxTotalOccurrenceCount()
Gets the maximum total number of occurrences of all terms in a search query. The default value is 500000 .
Returns:
int - The maximum total number of occurrences.
setMaxTotalOccurrenceCount(int value)
public void setMaxTotalOccurrenceCount(int value)
Sets the maximum total number of occurrences of all terms in a search query. The default value is 500000 .
Parameters:
Parameter
Type
Description
value
int
The maximum total number of occurrences.
getMaxOccurrenceCountPerTerm()
public int getMaxOccurrenceCountPerTerm()
Gets the maximum number of occurrences of each term in a search query. The default value is 100000 .
Returns:
int - The maximum number of occurrences of each term in a search query.
setMaxOccurrenceCountPerTerm(int value)
public void setMaxOccurrenceCountPerTerm(int value)
Sets the maximum number of occurrences of each term in a search query. The default value is 100000 .
Parameters:
Parameter
Type
Description
value
int
The maximum number of occurrences of each term in a search query.
getDateFormats()
public DateFormatCollection getDateFormats()
Gets the collection of date formats for date range search. The default date formats are ‘dd.MM.yyyy’, ‘MM/dd/yyyy’, and ‘yyyy-MM-dd’.
Returns:DateFormatCollection - The collection of date formats for date range search.
The example demonstrates how to set the date formats for the search.
```
String indexFolder = "c:\\MyIndex\\";
String documentsFolder = "c:\\MyDocuments\\";
String query = "Einstein";
Index index = new Index(indexFolder); // Creating an index in the specified folder
index.add(documentsFolder); // Indexing documents from the specified folder
SearchOptions options = new SearchOptions();
options.getDateFormats().clear(); // Removing default date formats
DateFormatElement[] elements = new DateFormatElement[] {
DateFormatElement.getMonthTwoDigits(),
DateFormatElement.getDayOfMonthTwoDigits(),
DateFormatElement.getYearFourDigits(),
};
// Creating a date format pattern 'MM/dd/yyyy'
com.groupdocs.search.DateFormat dateFormat = new com.groupdocs.search.DateFormat(elements, "/");
options.getDateFormats().addItem(dateFormat);
SearchResult result = index.search(query, options); // Search in index
```
isChunkSearch()
public boolean isChunkSearch()
Gets the flag of search by chunks. The default value is false .
Returns:
boolean - The flag of search by chunks.
setChunkSearch(boolean value)
public void setChunkSearch(boolean value)
Sets the flag of search by chunks. The default value is false .
Parameters:
Parameter
Type
Description
value
boolean
The flag of search by chunks.
getSearchDocumentFilter()
public ISearchDocumentFilter getSearchDocumentFilter()
Gets the search document filter. SearchDocumentFilter works on the inclusion logic. Use SearchDocumentFilter class for creation of a search document filter instances. The default value is null , which means that all found documents will be returned.
public void setSearchDocumentFilter(ISearchDocumentFilter value)
Sets the search document filter. SearchDocumentFilter works on the inclusion logic. Use SearchDocumentFilter class for creation of a search document filter instances. The default value is null , which means that all found documents will be returned.