~ubuntu-branches/ubuntu/vivid/sphinxsearch/vivid

« back to all changes in this revision

Viewing changes to api/java/SphinxClient.java

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2012-04-05 09:25:55 UTC
  • mfrom: (1.2.1) (7.1.3 sid)
  • Revision ID: package-import@ubuntu.com-20120405092555-65tc91rowhls3kob
Tags: 2.0.4-0ubuntu1
* New upstream release (LP: #930747)
* Remove explicit depends on libmysqlcient16 (LP: #974427)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * $Id: SphinxClient.java 2887 2011-07-14 14:20:35Z tomat $
 
2
 * $Id: SphinxClient.java 3132 2012-03-01 11:38:42Z klirichek $
3
3
 *
4
4
 * Java version of Sphinx searchd client (Java API)
5
5
 *
6
6
 * Copyright (c) 2007, Vladimir Fedorkov
7
 
 * Copyright (c) 2007-2011, Andrew Aksyonoff
8
 
 * Copyright (c) 2008-2011, Sphinx Technologies Inc
 
7
 * Copyright (c) 2007-2012, Andrew Aksyonoff
 
8
 * Copyright (c) 2008-2012, Sphinx Technologies Inc
9
9
 * All rights reserved
10
10
 *
11
11
 * This program is free software; you can redistribute it and/or modify
42
42
        public final static int SPH_RANK_MATCHANY               = 5;
43
43
        public final static int SPH_RANK_FIELDMASK              = 6;
44
44
        public final static int SPH_RANK_SPH04                  = 7;
45
 
        public final static int SPH_RANK_TOTAL                  = 8;
 
45
        public final static int SPH_RANK_EXPR                   = 8;
 
46
        public final static int SPH_RANK_TOTAL                  = 9;
46
47
 
47
48
        /* sorting modes */
48
49
        public final static int SPH_SORT_RELEVANCE              = 0;
193
194
                _indexWeights   = new LinkedHashMap();
194
195
                _fieldWeights   = new LinkedHashMap();
195
196
                _ranker                 = SPH_RANK_PROXIMITY_BM25;
 
197
                _rankexpr               = "";
196
198
 
197
199
                _overrideTypes  = new LinkedHashMap();
198
200
                _overrideValues = new LinkedHashMap();
504
506
        }
505
507
 
506
508
        /** Set ranking mode. */
507
 
        public void SetRankingMode ( int ranker ) throws SphinxException
 
509
        public void SetRankingMode ( int ranker, String rankexpr ) throws SphinxException
508
510
        {
509
511
                myAssert ( ranker>=0 && ranker<SPH_RANK_TOTAL, "unknown ranker value; use one of the SPH_RANK_xxx constants" );
 
512
                _rankexpr = ( rankexpr==null ) ? "" : rankexpr;
510
513
                _ranker = ranker;
511
514
        }
512
515
 
819
822
                        out.writeInt(_limit);
820
823
                        out.writeInt(_mode);
821
824
                        out.writeInt(_ranker);
 
825
                        if ( _ranker == SPH_RANK_EXPR ) {
 
826
                                writeNetUTF8(out, _rankexpr);
 
827
                        }
822
828
                        out.writeInt(_sort);
823
829
                        writeNetUTF8(out, _sortby);
824
830
                        writeNetUTF8(out, query);
1500
1506
}
1501
1507
 
1502
1508
/*
1503
 
 * $Id: SphinxClient.java 2887 2011-07-14 14:20:35Z tomat $
 
1509
 * $Id: SphinxClient.java 3132 2012-03-01 11:38:42Z klirichek $
1504
1510
 */