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 775943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:22:19+00:00 2026-05-14T19:22:19+00:00

I am running Solr on my windows machine using jetty. I have downloaded the

  • 0

I am running Solr on my windows machine using jetty. I have downloaded the Spatial Solr Plugin which I finally managed to get up and running. I am also using Solrnet to query against Solr from my asp.net mvc project.

Now, adding data into my index seems to work fine and the SpatialTierUpdateProcessorFactory does work as well.

The problem is:

How do I add the spatial query to my normal query using the Solrnet library. I have tried adding it using the “ExtraParams” parameter but that didn’t work very well.

Here is an example of me trying to combine the spatial query with a data range query. The date range query works fine without the spatial query attached to it:

new SolrQuery("{!spatial lat=51.5224 long=-2.6257 radius=10000 unit=km calc=arc threadCount=2}") && new SolrQuery(MyCustomQuery.Query) && new SolrQuery(DateRangeQuery);

which results in the following query against Solr:

(({!spatial lat=51.5224 long=-2.6257 radius=100 unit=km calc=arc threadCount=2} AND *:*) AND _date:[2010-05-07T13:13:37Z TO 2011-05-07T13:13:37Z])

And the error message I get back is:

The remote server returned an error: (400) Bad Request.

SEVERE: org.apache.solr.common.SolrException: org.apache.lucene.queryParser.Pars
eException: Cannot parse '(({!spatial lat=51.5224 lng=-2.6257 radius=10000 unit=
km calc=arc threadCount=2} AND *:*) AND _date:[2010-05-07T13:09:49Z TO 2011-05-0
7T13:09:49Z])': Encountered " <RANGEEX_GOOP> "lng=-2.6257 "" at line 1, column 2
4.
Was expecting:
    "}" ...

Now, the thing is if I use the Solr Web Admin page and execute the following query against it, everything works fine.

{!spatial lat=50.8371 long=4.35536 radius=100 calc=arc unit=km threadcount=2}text:London

What is the best/correct way to call the spatial function using SolrNet. Is the best way to somehow add that bit of the query manually to the query string and is so how?

  • 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-05-14T19:22:20+00:00Added an answer on May 14, 2026 at 7:22 pm

    Use the LocalParams class to represent LocalParams in Solr:

    solr.Query(new LocalParams {
        {"type", "spatial"},
        {"lat", "-51.5224"},
        {"long", "-2.6257"},
        {"radius", "10000"},
        {"unit", "km"},
        {"calc", "arc"},
        {"threadCount", "2"},
    } + Query.Field("text").Is("London"));
    

    This is available as of SolrNet 0.3.0b1.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

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.