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

  • Home
  • SEARCH
  • 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 556065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:52:50+00:00 2026-05-13T11:52:50+00:00

I have two table fields in a MySQL table. One is VARCHAR and is

  • 0

I have two table fields in a MySQL table.
One is VARCHAR and is a “headline” for a classified (classifieds website).
The other is TEXT field which contains the “text” for the classified.

Two Questions:
How should I determine how to index these two fields? (what field-type, what classes to use etc)

Currently I have an “ad_id” as a unique identifier for each ad, example “bmw_m3_82398292”.
How can I make SOLR return this identifier whenever a ‘query match’ is found by SOLR?
(The first part of the identifier is actually the headline fields content, the second part is a random number chosen)

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-05-13T11:52:50+00:00Added an answer on May 13, 2026 at 11:52 am

    1. Schema

    Your Solr schema is very much determined by your intended search behavior. In your schema.xml file, you’ll see a bunch of choices like “text” and “string”. They behave differently.

    <fieldtype name="string" class="solr.StrField" sortMissingLast="true"     omitNorms="true"/>
    

    The string field type is a literal string match. It would operate like == in a SQL statement.

    <fieldtype name="text_ws"   class="solr.TextField"          positionIncrementGap="100">
      <analyzer>
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
      </analyzer>
    </fieldtype>
    

    The text_ws field type does tokenization. However, a big difference in the text field is the filters for stop-words and delimiters and lower-casing. Notice how these filters are designated for both the Lucene index and the Solr query. So when searching a text field, it will adapt the query terms using these filters to help find a match.

    <fieldtype name="text"      class="solr.TextField"  positionIncrementGap="100">
      <analyzer type="index">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
        <filter ..... />
        <filter ..... />
        <filter ..... />
      </analyzer>
    </fieldtype>
    

    When indexing things like news stories, for example, you probably want to search for company names and headlines differently.

    <field name="headline" type="text" />
    <field name="coname" type="string" indexed="true" multiValued="false" omitNorms="true" />
    

    The above example would allow you to do a search like &coname:Intel&headline:processor+specifications and retrieve matches hitting exactly Intel stories.

    If you wanted to search a range

    2. Result Fields

    You can defined a standard set of return fields in your RequestHandler

    <requestHandler name="mumble" class="solr.DisMaxRequestHandler" >
        <str name="fl">
            category,coname,headline
        </str>
    </requestHandler>
    

    You may also define the desired fields in your query string, using the fl parameter.:

    /select?indent=on&version=2.2&q=coname%3AIn*&start=0&rows=10&fl=coname%2Cid&qt=standard
    

    You can also select ranges in your query terms using the field:[x TO *] syntax. If you wanted to select certain ads by their date , you might build a query with

    ad_date:[20100101 TO 20100201]
    

    in your query terms. (There are many ways to search ranges, I’m presenting a method that uses integers instead of Date class.)

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

Sidebar

Ask A Question

Stats

  • Questions 296k
  • Answers 296k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Make sure the MEDIA_ROOT directory exists Check your permissions, make… May 13, 2026 at 7:00 pm
  • Editorial Team
    Editorial Team added an answer #nav ul looks for an ul element within an element… May 13, 2026 at 7:00 pm
  • Editorial Team
    Editorial Team added an answer You're probably looking inside the error list window. Which I… May 13, 2026 at 7:00 pm

Related Questions

In a MySQL database, I have a table which contains itemID, itemName and some
I have two models and a join table, User , Post and posts_users .
I've been beating my brains in over this and I'm making no progress. I'm
I have a MySQL db and inside it a table called ProductMaster with 6
I have three tables called: users , facilities , and staff_facilities . users contains

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.