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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:55:06+00:00 2026-05-13T14:55:06+00:00

I have a String field where I store two-word area names. Ex: New York

  • 0

I have a String field where I store two-word area names.
Ex: New York

Thing is, whenever I try to query that field (area:New York) no results come up, even though it is stored exactly as New York.

Why is this?

The results DO come up if I search like this: area:"New York" but they wont come up if searching like this: area:New.

Any ideas?

Here is the field-definition in the schema.xml file:

  <fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/>
  <field name="area" type="string" indexed="true" stored="true" omitNorms="true"/>

If you need more input let me know!

Thanks

UPDATE

   $fq.=" + area:$state";

I am sending this, and Solr receives this as the variable inside state (New York)…

How can I rewrite this so it sends the variable as “New York” (with double quotes)…?

  • 1 1 Answer
  • 1 View
  • 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-13T14:55:07+00:00Added an answer on May 13, 2026 at 2:55 pm

    Could be a conflict with the reserved keyword New have you tried to retrieve similar results using a different two-word area, such as Las Vegas?

    Also, if the area field is expecting a String to always use quotes around your variables.

    EDIT:

    I do not have any experience using SOLR but assuming area:$state holds New York, I would try inserting the quotes into my code, like so:

    $fq.=" + area:\"$state\" ";
    

    It might not be correct, but it could help point you in the right direction.

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

Sidebar

Related Questions

I have a string field in database that keeps numbers as string. when I
I have annotated a String field with @NotEmpty tag. When I try to persist
I have to convert an incoming String field into a BigDecimal field that would
I have a form in which i use two dimensional array for field names.The
I have a set of string that I need to store in a set,
I have ONE string field which is in format: TransactionID=30000001197169 ExecutionStatus=6 additionalCurrency=KMK pin= 0000
I have an input field whose name is an MD5 string e.g.: <input type=hidden
I Have a object which the following field : boost::unordered_map<std::string, std::shared_ptr<Foo> > m_liste_; I
I have model: # encoding: utf-8 class Tag include Mongoid::Document field :name, type: String
Suppose I have this annotation @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.FIELD) public @interface Name { String value(); }

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.