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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:52:32+00:00 2026-05-31T05:52:32+00:00

When I add a document solr with the use of solrj is the content

  • 0

When I add a document solr with the use of solrj is the content then encoded?

CommonsHttpSolrServer server = new CommonsHttpSolrServer(
            "http://localhost:8080/solr/");
SolrInputDocument doc = new SolrInputDocument();
doc.addField("id", 1);
doc.addField("city", "Zürich");
server.add(doc);
server.commit();

Because when i search for it with the following code I can not find it (other towns work).

SolrQuery solrQuery = new SolrQuery();
solrQuery.set(CommonParams.WT, "json");
solrQuery.setQuery("Zürich");

QueryResponse rsp = locationSearchServer.query(solrQuery);
return rsp.getBeans(City.class);

I can see in the debugger that the query parameter is encoded to UTF-8 automatically.

I have also added the UTF-8 property to tomcat http://wiki.apache.org/solr/SolrTomcat#URI_Charset_Config but with no effect.

Do I have to add the content encoded or does solrj this for me?

  • 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-31T05:52:34+00:00Added an answer on May 31, 2026 at 5:52 am

    The problem is that queries by GET can fail with international characters. Normally this should be solved by the Tomcat-Param, but in my case not.

    A solution which works allways is send it as POST

    QueryResponse rsp = locationSearchServer.query(solrQuery, METHOD.POST);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently storing a collection of documents to one Solr server via SolrServer.add(Collection<SolrInputDocument>
It's a weird problem but every time I add a new document to Lucene.net
jQuery code add new virtual object .add to object .main $(document).ready(function(){ $('.main').on('click', '.add', function
I'm Posting the following to the Solr Server: <add> <doc> <field name=uniqueid>5453543</field> <field name=modifieddate>2008-12-03T15:49:00Z</field>
How can you add a new page to an iText document? document.newPage(); doesn't seem
I'm using a PHP library called solr-php-client (http://code.google.com/p/solr-php-client/) to interface with my Solr server.
When the user creates a document, I add the date to the solr index.
I want to check, if user can add document in document library then custom
How do I add the following document type to the begining of an XML
I'm trying to add an embedded document to an existing document field. I 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.