I've created a search function and for this I created a new indexer and searcher for that. The problem is when I enter a search query with a white space in it. Example below.
Data
I've got this persons created and stands inside my index:
+---------------+------------+-------------+
| Person number | First name | Last name |
+---------------+------------+-------------+
| 1 | Ilse | Van de Burg |
| 2 | Devolder | Marlijn |
+---------------+------------+-------------+
Search results
I've tried next queries:
+--------------+------------------+----------------+------------------+
| Query number | Term | Actual result* | Accepted result* |
+--------------+------------------+----------------+------------------+
| 1 | van | 1 | 1 |
| 2 | van de | 1 | 1 |
| 3 | ilse | 1 | 1 |
| 4 | van de burg | | 1 |
| 5 | van de burg ilse | | 1 |
| 6 | de | 1 & 2 | 1 & 2 |
| 7 | devolder | 2 | 2 |
| 8 | devolder marlijn | | 2 |
| 9 | marijn devolder | | 2 |
+--------------+------------------+----------------+------------------+
* number of the person. if empty: nothing found or accepted
Question
Some queries are not what I accepted. How could I solve this?
The problem here is when I get two persons with the same last name. For example:
+---------------+------------+-----------+
| Person number | First name | Last name |
+---------------+------------+-----------+
| 3 | Marc | De Vadder |
| 4 | Freddy | De vadder |
+---------------+------------+-----------+
Search results:
+--------------+------------------+----------------+------------------+
| Query number | Term | Actual result* | Accepted result* |
+--------------+------------------+----------------+------------------+
| 10 | de vadder | 3 & 4 | 3 & 4 |
| 11 | de vadder freddy | 3 & 4 | 4 |
| 11 | de vadder marc | 3 & 4 | 3 |
+--------------+------------------+----------------+------------------+
* number of the person. if empty: nothing found or accepted
{ SearchIndexType: , LuceneQuery: (naam:van de burg* (naam:van de burg)) (voornaam:van de burg* (voornaam:van de burg)) (titel:van de burg* (titel:van de burg)) }
P.S.: Uses the last query of my question and search term van de burg.
Search doesn't work when I use spaces.
My situation
I've created a search function and for this I created a new indexer and searcher for that. The problem is when I enter a search query with a white space in it. Example below.
Data
I've got this persons created and stands inside my index:
Search results
I've tried next queries:
Question
Some queries are not what I accepted. How could I solve this?
My code
Here is my code I've made:
Configurations update
Examine index
Examine settings (examine index provider):
Examine settings (examine search provider):
Tried also
I've also tried this and got the best results:
The problem here is when I get two persons with the same last name. For example:
Search results:
hein,
Can you write out searchCriteria.ToString() and paste back the result. This will give you the generated lucene query.
Regards
Ismail
searchCriteria.ToString()
gives me this:P.S.: Uses the last query of my question and search term
van de burg
.is working on a reply...