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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T02:12:14+00:00 2026-06-19T02:12:14+00:00

I am trying to write a lucene query to retrieve some pages in my

  • 0

I am trying to write a lucene query to retrieve some pages in my website so I have the following:

string.Format("nodeName: ({0})^7 bodyText: ({0})^6", _searchTerm)

which means it will search for content that either has the nodeName or the bodyText that includes the _searchTerm variable

where I am struggling is that I also want it to not include any results that have a hideInNav flag set to 1 so I tried:

string.Format("nodeName: ({0})^7 bodyText: ({0})^6 +hideInNav: NOT(1)", _searchTerm)

However this is throwing up the following error:

Encountered " <NOT> "NOT "" at line 1, column 140.
Was expecting one of:
   "(" ...
   "*" ...
   <QUOTED> ...
   <TERM> ...
   <PREFIXTERM> ...
   <WILDTERM> ...
   "[" ...
   "{" ...
   <NUMBER> ...

As far as I can tell the query does have a ( after the NOT so I’m stumped as to where this is being expected

  • 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-19T02:12:15+00:00Added an answer on June 19, 2026 at 2:12 am

    Try this query:

    string.Format("nodeName: ({0})^7 bodyText: ({0})^6 !hideInNav: (1)", _searchTerm)
    

    The exclamation mark can also be changed to NOT:

    string.Format("nodeName: ({0})^7 bodyText: ({0})^6 NOT hideInNav: (1)", _searchTerm)
    

    See this page for an overview of the Lucene Query syntax (it’s not the current version but I doubt it changed a lot)

    Edit: maybe reversing you hideInNave statement will fix it:

    string.Format(“nodeName: ({0})^7 bodyText: ({0})^6 +hideInNav: (0)”, _searchTerm) to check if it is zero or check if it is zero.

    You might want to also download Luke to check the content of your index and see how values are saved.

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

Sidebar

Related Questions

I'm trying write a query to find records which don't have a matching record
trying to write a functional php script to detect charset retrieve web pages. My
The following is part of a larger Script-fu script that I am trying write.
Trying to write some helper methods for an express 3.0 app. Here is an
Trying to write a code that searches hash values for specific string's (input by
I'm trying write a simple perl script that reads some fields from a password
Trying to write a trivial application, But I have stuck into one of the
I am trying write a shell script that does the following: Checks the remote
I am trying to write a lucene search in an Alfresco webscript (javascript) to
I am trying to write a simple program using Lucene 2.9.4 which searches for

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.