@atirtahir3
Please find them here : docs.zip (1.1 MB)
We didnât face any issue - See output.PNG (63.2 KB). What we did:
- Deleted indexed files
- Added new files (provided by you) in the document directory
- Created index in directory
- Performed simple search
@atirtahir3
Exactly, Its working perfectly at your end.
Is there any need to create index every time, when I need to search a new query ?
Where am I going wrong then? I followed the same steps too !
There seems to be an issue or two at my end, for sure, because that day too, I got it working for me after so much efforts.
Any idea ? Maybe some environment or config requirements ?
Is there any issue with the evaluation version ?
Did you apply license properly? Even if you have a temporary license and it is applied properly, you will not face limitations. Make sure license is not expired.
You donât have to create index every time until and unless you do some changes in the existing documents or you add new files in the documents directory.
Only in case of any change in the documents directory you have to update index. Currently, thereâs some issue in updating the index and we are investigating this. So, you have to clear index directory and then create index again.
@atirtahir3
I donât understand, what the issue is !
I am using the 30 days temporary licensed version for GroupDocs. The license is perfectly applied and I got it about an hour ago, approx, so I donât think so there could be any case of expiry.
I am unable to understand the behaviour, sometimes it is working, for the previously searched terms, itâs working fine, on the other hand sometimes(mostly) itâs giving no response. I am following the same prescribed steps , still facing this unexpected behaviour.
I am searching for, âthisâ and I have it in my documents, still getting no response.Is this how I need to struggle everytime for a new search ?
What to do in this case ?
Let us elaborate you why you donât get hits/output when you search âThisâ word. You have to disable using stop words in your code as follows:
index.getIndexingSettings().setUseStopWords(false);
index.addToIndex(Utilities.DOCUMENTS_PATH);
Please go through this article for further clarification. Using stop words is enabled by default. So it doesnât index words such as a, an, the, it, were, this etc. Hence, they donât appear in search results.
Please disable them and try again (Set setUseStopWords to false).
You donât have to do any struggle if you search any term that is already available in the docs. But when you update a doc or add new doc in the directory then you have to update index and perform search.
Below is the code to find out if the search term/word is Stop Word or not:
SearchResults searchResults = index.search(searchQuery);
System.out.println("Search result message: " + searchResults.getMessage());
@atirtahir3
Thanks for the information ! This is helpful.
I disabled these stop words, and it worked.
While, using index.update(), is giving an ArrayIndexOutOfBoundException. Following is the exception stack trace :
Exception in thread âmainâ java.lang.ArrayIndexOutOfBoundsException: 0
at com.groupdocs.search.et.a(Unknown Source)
at com.groupdocs.search.ay.a(Unknown Source)
at com.groupdocs.search.ay.dl(Unknown Source)
at com.groupdocs.search.ay.a(Unknown Source)
at com.groupdocs.search.bZ.o(Unknown Source)
at com.groupdocs.search.cm.b(Unknown Source)
at com.groupdocs.search.ch.a(Unknown Source)
at com.groupdocs.search.Index.a(Unknown Source)
at com.groupdocs.search.Index.a(Unknown Source)
at com.groupdocs.search.Index.update(Unknown Source)
at com.groupdocs.search.Index.update(Unknown Source)
at com.groupdocs.search.examples.Searching.simpleSearch(Searching.java:46)
at com.groupdocs.search.examples.MainClass.main(MainClass.java:17)
And, this is the code snippet :
public static void simpleSearch() {
License lic = new License();
lic.setLicense("xyz");
// Create index
Index index = new Index(Utilities.INDEX_PATH);
index.getIndexingSettings().setUseStopWords(false);
// Add documents to index
index.addToIndex(Utilities.DOCUMENTS_PATH);
// Search in index
String searchQuery = "you";
index.update();
SearchResults searchResults = index.search(searchQuery);
index.highlightInText(Utilities.DOCUMENT_TEXT_PATH, searchResults.get_Item(0));
// Print results in the console
for (DocumentResultInfo result : searchResults) {
System.out.println(result.getHitCount() + " hits are in " + result.getFileName());
}
}
This is solved as soon as I remove, index.update()
This is under investigation with ID : SEARCHJAVA-82. As we have any further update on this, youâll be notified.
Let me share reason for this issue.
The problem occurs during re-indexing of password protected documents that are available in the directory. It will be fixed and youâll be notified about that.
Right now, as a temporary solution, you can exclude password protected documents from indexing or provide the valid passwords for them.
Hi ! @atirtahir3
Hope you are doing good !
Well, why is it so, that every new time simple search stops performing.
I came back to it today to try some new queries but it again stopped working. Everything is same, license is applied, I created index each time I ran it.
Please help me with this as it is very annoying. I am actually searching a for a fast and efficient document search tool. Groupdocs solved many of my requirements, but this behaviour each time, I am afraid !
We are sorry for the inconvenience you are facing.
Can you please share string/word that you are trying to search and in which document such a word exists, weâll then investigate it at our end. (assuming that you are searching on same document directory)?
We are pleased to notify you that your reported issue SEARCHJAVA-82 is now resolved in version 19.5.1. Please download and integrate latest release of the API and share your feedback.