Comments (2)
I ended up modifying the search method in ElasticClient-Search.cs;
public QueryResponse<T> Search<T>(string search, string typeName = null) where T : class
{
return this.Query<T>(search, typeName);
}
Then modifying the Query Method as well;
private QueryResponse<T> Query<T>(string query, string type = null) where T : class
{
var index = this.Settings.DefaultIndex;
index.ThrowIfNullOrEmpty("Cannot infer default index for current connection.");
var queryType = typeof(T);
var typeName = type != null ? type : this.InferTypeName<T>();
string path = this.CreatePath(index, typeName) + "_search";
var status = this.Connection.PostSync(path, query);
if (status.Error != null)
{
return new QueryResponse<T>()
{
IsValid = false,
ConnectionError = status.Error
};
}
var response = JsonConvert.DeserializeObject<QueryResponse<T>>(status.Result, this.SerializationSettings);
return response;
}
This of course requires usage of .NET 4.0 with the optional parameter, not sure if you want a pull request to move to 4.0 or not.
from elasticsearch-net.
Hey thanks for taking the effort to fix it yourself :) For now i'd like to be 3.5 compatible, hence all the overload madness :(
Search is still under heavy development, right now it only maps queries. I am working on facets at the moment and then working on highlighting. Focus is sadly only on getting all the search responses mapped properly before deciding on query DSL and clouding search with 30 overloads :)
from elasticsearch-net.
Related Issues (20)
- SingleBucketAggregate is missing HOT 1
- Bulk delete API is not respecting the index in the current request
- Logical operations between QueryDescriptor objects are not allowed HOT 2
- ElasticSearch incorrecly serialize percolated queries HOT 5
- Missing Support for term range queries HOT 4
- AggregationContainer is missing HOT 1
- Invalid serialization of reindex request when using op type
- Add Indices.AnalyzeAsync to 8.x HOT 1
- [FEATURE] ElasticSearch 8 took away support for "Nullable" fields for Term Query HOT 9
- [FEATURE] Unable to use Term Query for Enums HOT 1
- SystemTextJsonSerializer.Serialize ignores SerializationFormatting HOT 1
- Creating an index with DynamicTemplates causes error HOT 4
- Cannot run knn query using elasticClient.RequestResponseSerializer HOT 5
- Unable to use descriptors to set Fields in MultiMatchQueryDescriptor query HOT 2
- Mystic MissingMethodException HOT 1
- A call to client.Cluster.StatsAsync fails with JSON serialization error HOT 2
- Provide a way to convert QueryDescriptor to Query (Elastic.Clients.Elasticsearch, 8.11.0) HOT 2
- Question: how to map the properties for a nested type - v8 HOT 1
- Add dotnet 6 TFM to reduce dependencies HOT 1
- Deprecation of old nugets and transfer of downloads HOT 1
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 elasticsearch-net.