~ubuntu-branches/ubuntu/trusty/sphinxsearch/trusty-proposed

« back to all changes in this revision

Viewing changes to api/java/SphinxResult.java

  • Committer: Bazaar Package Importer
  • Author(s): Radu Spineanu
  • Date: 2009-11-17 22:19:42 UTC
  • Revision ID: james.westby@ubuntu.com-20091117221942-nm751ur701m9vrzt
Tags: upstream-0.9.8.1
ImportĀ upstreamĀ versionĀ 0.9.8.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * $Id: SphinxResult.java 1172 2008-02-24 13:50:48Z shodan $
 
3
 */
 
4
 
 
5
package org.sphx.api;
 
6
 
 
7
/**
 
8
 * Search result set.
 
9
 *
 
10
 * Includes retrieved matches array, status code and error/warning messages,
 
11
 * query stats, and per-word stats.
 
12
 */
 
13
public class SphinxResult
 
14
{
 
15
        /** Full-text field namess. */
 
16
        public String[]                 fields;
 
17
 
 
18
        /** Attribute names. */
 
19
        public String[]                 attrNames;
 
20
 
 
21
        /** Attribute types (refer to SPH_ATTR_xxx constants in SphinxClient). */
 
22
        public int[]                    attrTypes;
 
23
 
 
24
        /** Retrieved matches. */
 
25
        public SphinxMatch[]    matches;
 
26
 
 
27
        /** Total matches in this result set. */
 
28
        public int                              total;
 
29
 
 
30
        /** Total matches found in the index(es). */
 
31
        public int                              totalFound;
 
32
 
 
33
        /** Elapsed time (as reported by searchd), in seconds. */
 
34
        public float                    time;
 
35
 
 
36
        /** Per-word statistics. */
 
37
        public SphinxWordInfo[] words;
 
38
 
 
39
        /** Warning message, if any. */
 
40
        public String                   warning = null;
 
41
 
 
42
        /** Error message, if any. */
 
43
        public String                   error = null;
 
44
 
 
45
 
 
46
        /** Query status (refer to SEARCHD_xxx constants in SphinxClient). */
 
47
        private int                             status = -1;
 
48
 
 
49
 
 
50
        /** Trivial constructor, initializes an empty result set. */
 
51
        public SphinxResult()
 
52
        {
 
53
                this.attrNames = new String[0];
 
54
                this.matches = new SphinxMatch[0];;
 
55
                this.words = new SphinxWordInfo[0];
 
56
                this.fields = new String[0];
 
57
                this.attrTypes = new int[0];
 
58
        }
 
59
 
 
60
        /** Get query status. */
 
61
        public int getStatus()
 
62
        {
 
63
                return status;
 
64
        }
 
65
 
 
66
        /** Set query status (accessible from API package only). */
 
67
        void setStatus ( int status )
 
68
        {
 
69
                this.status = status;
 
70
        }
 
71
}
 
72
 
 
73
/*
 
74
 * $Id: SphinxResult.java 1172 2008-02-24 13:50:48Z shodan $
 
75
 */