Author: thomas.heute(a)jboss.com
Date: 2007-08-09 09:15:49 -0400 (Thu, 09 Aug 2007)
New Revision: 7884
Added:
branches/JBoss_Portal_Branch_2_6/search/src/main/org/jboss/portal/search/query/BooleanClause.java
branches/JBoss_Portal_Branch_2_6/search/src/main/org/jboss/portal/search/query/BooleanQuery.java
branches/JBoss_Portal_Branch_2_6/search/src/main/org/jboss/portal/search/query/Term.java
branches/JBoss_Portal_Branch_2_6/search/src/main/org/jboss/portal/search/query/TermQuery.java
Removed:
branches/JBoss_Portal_Branch_2_6/search/src/main/org/jboss/portal/search/query/Query.java
branches/JBoss_Portal_Branch_2_6/search/src/main/org/jboss/portal/search/query/QueryTerm.java
branches/JBoss_Portal_Branch_2_6/search/src/main/org/jboss/portal/search/query/impl/
Log:
Added:
branches/JBoss_Portal_Branch_2_6/search/src/main/org/jboss/portal/search/query/BooleanClause.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/search/src/main/org/jboss/portal/search/query/BooleanClause.java
(rev 0)
+++
branches/JBoss_Portal_Branch_2_6/search/src/main/org/jboss/portal/search/query/BooleanClause.java 2007-08-09
13:15:49 UTC (rev 7884)
@@ -0,0 +1,62 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.search.query;
+
+import org.jboss.portal.search.Query;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class BooleanClause
+{
+ private Query query;
+
+ private boolean isRequired;
+
+ private boolean isProhibited;
+
+ public BooleanClause(Query query, boolean isRequired, boolean isProhibited)
+ {
+ this.query = query;
+ this.isRequired = isRequired;
+ this.isProhibited = isProhibited;
+ }
+
+ public Query getQuery()
+ {
+ return query;
+ }
+
+ public boolean isRequired()
+ {
+ return isRequired;
+ }
+
+ public boolean isProhibited()
+ {
+ return isProhibited;
+ }
+
+}
+
Added:
branches/JBoss_Portal_Branch_2_6/search/src/main/org/jboss/portal/search/query/BooleanQuery.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/search/src/main/org/jboss/portal/search/query/BooleanQuery.java
(rev 0)
+++
branches/JBoss_Portal_Branch_2_6/search/src/main/org/jboss/portal/search/query/BooleanQuery.java 2007-08-09
13:15:49 UTC (rev 7884)
@@ -0,0 +1,47 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.search.query;
+
+import java.util.List;
+
+import org.jboss.portal.search.Query;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class BooleanQuery implements Query
+{
+ private List clauses;
+
+ public BooleanQuery(List clauses)
+ {
+ this.clauses = clauses;
+ }
+
+ public List getClauses()
+ {
+ return clauses;
+ }
+}
+
Deleted:
branches/JBoss_Portal_Branch_2_6/search/src/main/org/jboss/portal/search/query/Query.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/search/src/main/org/jboss/portal/search/query/Query.java 2007-08-09
13:07:56 UTC (rev 7883)
+++
branches/JBoss_Portal_Branch_2_6/search/src/main/org/jboss/portal/search/query/Query.java 2007-08-09
13:15:49 UTC (rev 7884)
@@ -1,137 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.search.query;
-
-import java.util.ArrayList;
-import java.util.List;
-
-
-/**
- * The Query object is used to express a query.
- * Common queries use mandatory terms, optional terms and missing terms.
- * For instance you could do a query stating that you absolutely want
- * the keyword 'Mustang' in your query, that the keyword 'car' is
optional
- * and could be used to show the results with the two keywords higher
- * in the list and without the keyword 'horse'. In traditional search
- * tools it would be represented as the string: "+mustang car -horse"
- * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
- * @version $Revision$
- */
-public class Query
-{
-
- private List mandatoryTerms;
- private List optionalTerms;
- private List notTerms;
-
- /*
- private List mandatoryQueries;
- private List optionalQueries;
- private List notQueries;
- */
-
- public void addMandatoryTerm(QueryTerm term)
- {
- if (mandatoryTerms == null)
- {
- mandatoryTerms = new ArrayList();
- }
- mandatoryTerms.add(term);
- }
-
- public void addOptionalTerm(QueryTerm term)
- {
- if (optionalTerms == null)
- {
- optionalTerms = new ArrayList();
- }
- optionalTerms.add(term);
- }
-
- public void addNotTerm(QueryTerm term)
- {
- if (notTerms == null)
- {
- notTerms = new ArrayList();
- }
- notTerms.add(term);
- }
-
- /*
- public void addMandatoryQuery(Query query)
- {
- if (mandatoryQueries == null)
- {
- mandatoryQueries = new ArrayList();
- }
- mandatoryQueries.add(query);
- }
-
- public void addOptionalQuery(Query query)
- {
- if (optionalQueries == null)
- {
- optionalQueries = new ArrayList();
- }
- optionalQueries.add(query);
- }
-
- public void addNotQuery(Query query)
- {
- if (notQueries == null)
- {
- notQueries = new ArrayList();
- }
- notQueries.add(query);
- }
-
- public List getMandatoryQueries()
- {
- return mandatoryQueries;
- }
-*/
- public List getMandatoryTerms()
- {
- return mandatoryTerms;
- }
-/*
- public List getNotQueries()
- {
- return notQueries;
- }
-*/
- public List getNotTerms()
- {
- return notTerms;
- }
-/*
- public List getOptionalQueries()
- {
- return optionalQueries;
- }
-*/
- public List getOptionalTerms()
- {
- return optionalTerms;
- }
-}
Deleted:
branches/JBoss_Portal_Branch_2_6/search/src/main/org/jboss/portal/search/query/QueryTerm.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/search/src/main/org/jboss/portal/search/query/QueryTerm.java 2007-08-09
13:07:56 UTC (rev 7883)
+++
branches/JBoss_Portal_Branch_2_6/search/src/main/org/jboss/portal/search/query/QueryTerm.java 2007-08-09
13:15:49 UTC (rev 7884)
@@ -1,32 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.search.query;
-
-/**
- * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
- * @version $Revision$
- */
-public interface QueryTerm
-{
-
-}
Added:
branches/JBoss_Portal_Branch_2_6/search/src/main/org/jboss/portal/search/query/Term.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/search/src/main/org/jboss/portal/search/query/Term.java
(rev 0)
+++
branches/JBoss_Portal_Branch_2_6/search/src/main/org/jboss/portal/search/query/Term.java 2007-08-09
13:15:49 UTC (rev 7884)
@@ -0,0 +1,63 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.search.query;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class Term
+{
+
+ private String field;
+
+ private String text;
+
+ public Term(String field, String text)
+ {
+ setField(field);
+ setText(text);
+ }
+
+ public String getField()
+ {
+ return field;
+ }
+
+ public void setField(String field)
+ {
+ this.field = field;
+ }
+
+ public String getText()
+ {
+ return text;
+ }
+
+ public void setText(String text)
+ {
+ this.text = text;
+ }
+
+}
+
Added:
branches/JBoss_Portal_Branch_2_6/search/src/main/org/jboss/portal/search/query/TermQuery.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/search/src/main/org/jboss/portal/search/query/TermQuery.java
(rev 0)
+++
branches/JBoss_Portal_Branch_2_6/search/src/main/org/jboss/portal/search/query/TermQuery.java 2007-08-09
13:15:49 UTC (rev 7884)
@@ -0,0 +1,51 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.search.query;
+
+import org.jboss.portal.search.Query;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class TermQuery implements Query
+{
+ private Term term;
+
+ public TermQuery(Term term)
+ {
+ setTerm(term);
+ }
+
+ public Term getTerm()
+ {
+ return term;
+ }
+
+ public void setTerm(Term term)
+ {
+ this.term = term;
+ }
+
+}
+