Package com.k_int.IR

Examples of com.k_int.IR.SearchException


            setFragmentCount(hits.length());
            setTaskStatusCode(TASK_COMPLETE);
        } catch (java.io.IOException e) {
            LOGGER.warning("Io except " + e.getMessage());
            throw new SearchException("could not complete search"
                + "...server error: " + e.getMessage());
        } finally {
            try {
                searcher.close();
            } catch (java.io.IOException e) {
                LOGGER.warning("Io except " + e.getMessage());
                throw new SearchException("could not close backend searcher"
                    + "...server error: " + e.getMessage());
            }
        }

        return (getTaskStatusCode());
View Full Code Here


            retQuery.add(doConversion(complexQuery.getRHS()), false, true);

            break;

        case ComplexNode.COMPLEX_PROX:
            throw new SearchException("Proximity searches not supported.");

        default:
            throw new SearchException("Op type not recognized.");
        }

        return retQuery;
    }
View Full Code Here

     * @throws SearchException If the term node is null.
     */
    private Query convertTermNode(AttrPlusTermNode rpnTermNode)
        throws SearchException {
        if (rpnTermNode == null) {
            throw new SearchException("AttrPlusTermNode is null");
        }

        //LOGGER.finer("query attrset = " + query.toRPN().getAttrset());
        LOGGER.finer("attrplus term node = " + rpnTermNode);

        //unsure of if this should be true or false, determines if we quote
        //phrases or not.  Need to look at what our code is doing, if they help.
        String term = rpnTermNode.getTermAsString(false);

        if (term == null) {
            throw new SearchException("term passed in is null");
        }

        term = term.toLowerCase();

        //to lower case for case insensitivity, to mimic our Analyzer
        Enumeration _enum = rpnTermNode.getAttrEnum();
        String useVal = GeoProfile.Attribute.ANY; //default is any.
        int relation = GeoProfile.EQUALS; //default is equals.
        boolean truncation = false; //default is no truncation.
        boolean matchAll = false;

        while (_enum.hasMoreElements()) {
            AttrTriple triple = (AttrTriple) _enum.nextElement();
            String attrVal = triple.getAttrVal().toString();

            switch (triple.getAttrType().intValue()) {
            case GeoProfile.USE:
                useVal = attrVal;

                break;

            case GeoProfile.RELATION:
                relation = Integer.parseInt(attrVal);

                break;

            case GeoProfile.STRUCTURE:

                if (attrVal.equals(GeoProfile.Attribute.ALWAYS)) {
                    matchAll = true;
                }

                break;

            //REVISIT: currently we treat everything as
            //a string, decide what to do based on the use value.
            case GeoProfile.TRUNCATION:
                truncation = (attrVal.equals(GeoProfile.TRUNCATE));

                break;

            default:
                break;
            }
        }

        LOGGER.finer("use val = " + useVal);

        String searchField = attrMap.getProperty(useVal.toString());

        if (searchField == null) {
            throw new SearchException("Unsupported Use Attribute - " + useVal,
                GeoProfile.Diag.UNSUPPORTED_ATTR);
        }

        LOGGER.finest("search field is " + searchField);

View Full Code Here

TOP

Related Classes of com.k_int.IR.SearchException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.