From 9bfc5992dd0fb809748181e9e10460b2973f03f8 Mon Sep 17 00:00:00 2001 From: Aaditrii <52820786+Aaditrii@users.noreply.github.com> Date: Thu, 2 Jan 2020 22:48:00 +0530 Subject: [PATCH 1/3] Update SearchFiles.cpp --- src/demo/SearchFiles.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/demo/SearchFiles.cpp b/src/demo/SearchFiles.cpp index 93266ab..1322f18 100644 --- a/src/demo/SearchFiles.cpp +++ b/src/demo/SearchFiles.cpp @@ -25,7 +25,7 @@ using namespace lucene::search; void SearchFiles(const char* index){ - standard::StandardAnalyzer analyzer; + standard::StandardAnalyzer WhitespaceAnalyzer analyzer; char line[80]; TCHAR tline[80]; TCHAR* buf; @@ -54,7 +54,7 @@ void SearchFiles(const char* index){ _CLDELETE_LCARRAY(buf); uint64_t str = Misc::currentTimeMillis(); - Hits* h = s.search(q); + Hits* h = s.search(buf); uint32_t srch = (int32_t)(Misc::currentTimeMillis() - str); str = Misc::currentTimeMillis(); From b663e6b3799e7ce7640700df7b045611a1432be6 Mon Sep 17 00:00:00 2001 From: Aaditrii <52820786+Aaditrii@users.noreply.github.com> Date: Thu, 2 Jan 2020 23:14:46 +0530 Subject: [PATCH 2/3] updated this file previously ,if i searched for a query in a document,the program converted the query string into lowercase and the original query was replaced now this issue has been fixed. --- src/demo/SearchFiles.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/demo/SearchFiles.cpp b/src/demo/SearchFiles.cpp index 1322f18..4a9637f 100644 --- a/src/demo/SearchFiles.cpp +++ b/src/demo/SearchFiles.cpp @@ -50,11 +50,13 @@ void SearchFiles(const char* index){ Query* q = QueryParser::parse(tline,_T("contents"),&analyzer); buf = q->toString(_T("contents")); + Query* p=q; + _tprintf(_T("Searching for: %s\n\n"), buf); _CLDELETE_LCARRAY(buf); uint64_t str = Misc::currentTimeMillis(); - Hits* h = s.search(buf); + Hits* h = s.search(p); uint32_t srch = (int32_t)(Misc::currentTimeMillis() - str); str = Misc::currentTimeMillis(); From 556a04e8f459a9b72c3c005701048ab2dce999ab Mon Sep 17 00:00:00 2001 From: Aaditrii <52820786+Aaditrii@users.noreply.github.com> Date: Thu, 2 Jan 2020 23:29:01 +0530 Subject: [PATCH 3/3] Update SearchFiles.cpp previously,when any query was searched in a particular document say i want to know that if Abc is contained in any of my files in a particular folder so the previous program converted query to lowercase that is abc and find it,but now this problem has been fixed. --- src/demo/SearchFiles.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/demo/SearchFiles.cpp b/src/demo/SearchFiles.cpp index 4a9637f..4ea8977 100644 --- a/src/demo/SearchFiles.cpp +++ b/src/demo/SearchFiles.cpp @@ -25,7 +25,7 @@ using namespace lucene::search; void SearchFiles(const char* index){ - standard::StandardAnalyzer WhitespaceAnalyzer analyzer; + lucene::analysis::WhitespaceAnalyzer analyzer; char line[80]; TCHAR tline[80]; TCHAR* buf;