Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7943695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:20:46+00:00 2026-06-04T00:20:46+00:00

I started looking around for a search engine and after some reading I decided

  • 0

I started looking around for a search engine and after some reading I decided going with ElasticSearch (which is quite amazing :)), my project is in C# so I looked around for a client and started using NEST, everything is quite straightforward but I am a bit confused on the searching part.

I want to search all fields on a specific type what I came up with is the following code:

elasticClient.Search<NewType>(s => s.Query(q => q.QueryString(d => d.Query(queryString))));

I saw that much of the string query search is deprecated and wanted to make sure the above is the correct way of doing this (the above is not marked as deprecated…) also it is a bit long for a simple task so maybe anyone knows another way of doing this.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T00:20:47+00:00Added an answer on June 4, 2026 at 12:20 am

    I just use the string query version: create my query object using C# anonymous type and serialize it to JSON.

    That way, I can have straightforward mapping from all the JSON query examples out there, no need translating into this “query DSL”.

    Elasticsearch by itself evolves quite rapidly, and this query DSL thus is bound to lack some features.

    Edit: Example:

    var query = "blabla";
    var q = new
            {
                query = new
                {
                    text = new
                    {
                        _all= query
                    }
                }, 
                from = (page-1)*pageSize, 
                size=pageSize
            };
            var qJson = JsonConvert.SerializeObject(q);
            var hits = _elasticClient.Search<SearchItem>(qJson);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've recently started looking at Merb, for use with some small projects around the
I started looking into PhoneGap yesterday and created a simple marble rolling around while
I've started looking at re-writing some pages on a clients website and I can
I'm getting started with OpenGL ES on Android and I'd looking to learn some
I'm recently started to learn Twisted framework and now looking for some cheat sheets/reference
Occasionally I am looking at some code, I search for usages of a method
Started looking around for a global static, to set a color in one place,
I have recently started looking into using Azure but I'm having some issues getting
Just started to play around with node.js, have some past experience with JavaScript but
Working on a [rails] project, I've started playing around with RSS parsing. I notice

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.