Hi,

I get it working..here is logic that need to implement...

In function getTermQuery check term is stop word or not if it is stop
word then return null.
Otherwise return SrndTermQuery object..

Code ...

protected SrndQuery getTermQuery(
        String term, boolean quoted) {
       if(stopwordList != null && stopwordList.contains(term))
            return null;
    return new SrndTermQuery(term, quoted);
}

Here stopwordList is static collection..


Next in each Query function (NQuery, NotQuery, AndQuery, WQuery) add
code as per following OrQuery 


SrndQuery OrQuery() : {
  SrndQuery q;
  SrndQuery prevq = null;
  ArrayList queries = null;
  Token oprt = null;
}{
  q = AndQuery()
  ( oprt = <OR> { /* keep only last used operator */
      if (queries == null) {
        queries = new ArrayList();
      }
      if(q != null)
        queries.add(q);
      prevq = q;
      if(queries.size() >= 2){
         q = getOrQuery(queries, true /* infix */, oprt);
         return q;
      }


    }    
    q = AndQuery() {
      if(q != null)
        queries.add(q);
      else
        q = prevq;
        
      if(queries.size() >= 2){
            q = getOrQuery(queries, true /* infix */, oprt);
      }

    }
  )*
  {return q;}
}

Now generate QueryParser.java file using javaCC then do search..

Thanks,
Jagdish.


-----Original Message-----
From: Jagdish Vasani IN [mailto:[email protected]] 
Sent: Monday, August 23, 2010 7:33 PM
To: [email protected]
Subject: How to eliminate stop words from Surround query ?

Hi,

 

All , I want to eliminate stop words from surround  query how I can do
that ...as I am new to QueryParser languages(JavaCC) ..

Any Ideas or suggestions ?

 

Thanks,

Jagdish


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to