Comments (12)
@AaronSadlerUK .Field
and .NativeQuery
do fundamentally different things.
An escaped field search builds a "phrase query" and as such doesn't need to go through the query parser, whilst a native query will use the query parser to turn your string into an actual query and execute it "raw". The phrase query ensures an exact match for each term and not parts of each term.
What "type" is your "colour" field in the index, and what format are you expecting the value it to be? The likelihood here is your value isn't indexed quite as you'd expect.
e.g. "light-blue" would actually be indexed as "light" and "blue" by default – searching for "light-blue".Escape()
will do a phrase query for "light-blue" but that's not the value in the index. You'd need to index the value accordingly, such as changing the analyzer for that specific case.
Use a tool like Luke to inspect your index and find out what's happening.
from examine.
Thanks for that @callumbwhyte I am trying to open the indexes with like but having a nightmare
Once I manage to get in I'll see what's happening in terms of the Indexed value.
However it does work with the backoffice and as a raw query, so for example if I search with "Dark Blue" using the nativequery it works.
But if I do it using .Escape() it does not, I should know more if I can get Luke to work
from examine.
The backoffice is a whole different beast again ;-)
from examine.
@callumbwhyte Any ideas with this error?
I've tried rebuilding etc...
from examine.
Finally found a version which can read the indexes... 5.2.0
Can be found here for anyone looking:
https://github.com/DmitryKey/luke/releases/tag/luke-5.2.0
from examine.
Colour looks like this in the index:
It's also indexes as FullText
This field is used as an attribute, so the searching on it is always exact.
namedOptions.FieldDefinitions.AddOrUpdate(new FieldDefinition("colour", FieldDefinitionTypes.FullText));
Any other thoughts or pointers?
from examine.
@AaronSadlerUK If you right click on the value you can view the tokens, you should see 2 tokens: "light" and "green".
If you're trying to match 'Light Green'
to either of those terms it won't match.
Rather than indexing your field as FullText
you could opt for FieldDefinitionTypes.Raw
which shouldn't be analyzed and therefore the tokens for the value indexed will be "Light Green" exactly as you expect.
You could also modify the value at index time in the TransformingIndexValues
event, perhaps removing the space entirely?
from examine.
I was thinking about removing the space, but then I would need to create a whole thing to remove all the other different characters which are used such as /
and -
in different places.
I'll try the RAW way.
Am I right in thinking what I'm trying to do here would normally be done as a faceted search?
from examine.
this seems quite similar to #325, which has my current workaround but I'd love to get rid of that one.
Also an option is to use the token analyzer which doesn't split the text
options.IndexValueTypesFactory = new Dictionary<string, IFieldValueTypeFactory>
{
[FIELD_DEFINITION_KEYWORD] = new DelegateFieldValueTypeFactory(name =>
new GenericAnalyzerFieldValueType(
name,
_loggerFactory,
new KeywordAnalyzer(),
false
)
)
};
from examine.
Related Issues (20)
- Using GroupedOr() with a list of GUIDs creates a Lucene query with each segment of the GUID as a separate comparison HOT 1
- ValueSet.TryAdd in IndexProviderTransformingIndexValues doesn't exist after upgrade HOT 5
- Problem in getting Correct List Of Search Results HOT 6
- CultureInvariantStandardAnalyzer does not include the ASCIIFoldingFilter
- How to search Examine by Udi (content picker) property HOT 3
- System.NotSupportedException: 'Cannot convert search results to member instances' HOT 1
- Category filtering weird behavior HOT 1
- Failing unit tests (Examine.Test.Examine.Lucene.Search.FluentApiTests.Sort_Result_By_Double_Fields) HOT 3
- Project editorconfig HOT 1
- Examine Facets proposal HOT 31
- Support `DateOnly` in range query HOT 3
- Combination of MultipleCharacterWildcard() with Boost() not possible HOT 4
- TotalItemCount property performance HOT 1
- Escaped value returns no results when it should HOT 1
- Nested query doesn't return results HOT 3
- How to boost a document during indexing HOT 2
- Links in Readme are 404. HOT 1
- Examine GetFieldInternalQuery error HOT 20
- And( q=> q.GroupedOr(...)) adds and (+) to the first term of the groupedOr HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from examine.