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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T16:05:34+00:00 2026-06-18T16:05:34+00:00

Using Lucene’s standard analyzer. Title field in question is non-stored, analyzed. The query is

  • 0

Using Lucene’s standard analyzer. Title field in question is non-stored, analyzed. The query is as follows:

title:"Some-Url-Friendly-Title"

In Luke, this query gets correctly re-written as:

title:"some url friendly title" (- replaced by whitespace, everything lowercased).

I thought the Lucene.net version would be:

new TermQuery(new Term("title","Some-Url-Friendly-Title"))

However, no results are returned.

Then I tried:

_parser.GetFieldQuery("title","Some-Url-Friendly-Title")

And it worked as expected!

Both queries were executed via:
_searcher.Search([query object], [sort object])

Can somebody point me in the right direction to see what the differences between TermQuery and _parser.GetFieldQuery() are?

  • 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-18T16:05:35+00:00Added an answer on June 18, 2026 at 4:05 pm

    A TermQuery is much simpler than running a query through a queryparser. Not only is it not lowercased, and doesn’t understand to break up hyphenated terms, it isn’t even tokenized. It just searches for the term you tell it to look for. That means it is looking for the term “Some-Url-Friendly-Title” as a single untokenized keyword, in your index. I assume you are using an analyzer, so chances are no such tokens exist.

    To take it a step further, if you had been searching for “Some Url Friendly Title” as the Term text, you still wouldn’t come up with anything, since it’s looking for “Some Url Friendly Title” as a Single Token, not as the four tokens (or rather, terms) in your index.

    If you look at what a the standard query parser generates when you parse your query, you’ll see that TermQueries are only one of the building blocks it uses to generate the complete query, along with BooleanQuery, and possibly PhraseQuery, PrefixQueriy, etc.

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

Sidebar

Related Questions

Normally when using Lucene you set a search query and Lucene gives you some
I have some code using Lucene that leaves the default conjunction operator as OR,
I am looking into using Lucene.NET after reading some bad reviews of SQL Server's
I'm using Lucene for a job search portal using .net. Am facing some performance
I am using Lucene 3.6.1. I have a BooleanQuery some clauses of which are
Using Lucene.Net 2.4.0 is there some kind of built-in support for joining the results
I am using Lucene.NET and getting search results sorted by 'Date' field. Here are
I'm using lucene in my project. Here is my question: should I use lucene
I am using Lucene/Solr for my log search tool. Is there a way I
I'm using Lucene.Net to implement a search website (to search PDFs). Once the keyword

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.