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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:03:43+00:00 2026-06-12T19:03:43+00:00

I am executing query using WildcardQuery of Lucene.but I don’t know why the result

  • 0

I am executing query using WildcardQuery of Lucene.but I don’t know why the result cannot be found.
Below are the details.

Here is the code for create WildcardQuery,and The record of Field Name :’Full Name’ Value:’ABC123DD456CC’ is existed Index Document.

BooleanQuery booleanQuery = new BooleanQuery();
for (IndexQueryField field : quickSearchFields)
{
    Query query = new WildcardQuery(new Term(queryField.getFieldName(),"ABC*DD*CC"));
    booleanQuery.add(query, BooleanClause.Occur.SHOULD);
}

The part of code: Executing query:

Session hibernateSession               = (Session) em.getDelegate();
FullTextSession session                = SwitchSession.getFullTextSession(hibernateSession, specifyIndexName);

// Set Hibernate flushMode
session.setFlushMode(FlushMode.MANUAL);
// Ignore Hibernate Cache
session.setCacheMode(CacheMode.IGNORE);

            FullTextQuery query = session.createFullTextQuery(booleanQuery,XXX.class);
List list = query.setFirstResult(1).setMaxResults(100).list();

The list is empty, i am sure the ‘ABC123DD456CC’ is existed in Lucene Document.
I just want to do it with WildcardQuery. Any help will be thankful!

  • 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-12T19:03:44+00:00Added an answer on June 12, 2026 at 7:03 pm

    I believe that last line should be:

    List list = query.setFirstResult(0).setMaxResults(100).list();
    

    Since results are numbered from 0. If there is only 1 document matching that search, which seems likely enough, that probably explains why you’re getting nothing (having skipped the first and only result, at index 0).

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

Sidebar

Related Questions

How would I go about executing the following Hibernate query using the criteria API.
i am using a executing a query select lastlevel as VERSION,name as DESCRIPTION, TO_DATE(lastdate,
I am Executing One query using stored procedure object. i want to retreive number
I am using sqlalchemy with MySQL , and executing query with sql expression. When
I am connecting to a MySQL database using Java. I am executing this query:
I am looking for the syntax for executing MS Access named query using Microsoft.ACE.OLEDB.12.0
When I am executing a SQLite query (using sqlite4java) I am following the general
I am executing following sql query on SQL Server 2008 using jTDS API: SELECT
I am executing a mysql query in python using the MySQLdb package. The code
How do you lazy load nested lists without actually executing the query? Using a

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.