]> git.openstreetmap.org Git - nominatim.git/blob - lib/SearchDescription.php
add new class for searches
[nominatim.git] / lib / SearchDescription.php
1 <?php
2
3 namespace Nominatim;
4
5 /**
6  * Operators describing special searches.
7  */
8 abstract final class Operator
9 {
10     /// No operator selected.
11     const NONE = -1;
12     /// Search for POIs near the given place.
13     const NEAR = 0;
14     /// Search for POIS in the given place.
15     const IN = 1;
16     /// Search for POIS named as given.
17     const NAME = 3;
18     /// Search for postcodes.
19     const POSTCODE = 4;
20 }
21
22 /**
23  * Description of a single interpretation of a search query.
24  */
25 class SearchDescription
26 {
27     /// Ranking how well the description fits the query.
28     private $iSearchRank = 0;
29     /// Country code of country the result must belong to.
30     private $sCountryCode = '';
31     /// List of word ids making up the name of the object.
32     private $aName = array();
33     /// List of word ids making up the address of the object.
34     private $aAddress = array();
35     /// Subset of word ids of full words making up the address.
36     private $aFullNameAddress = array();
37     /// List of word ids that appear in the name but should be ignored.
38     private $aNameNonSearch = array();
39     /// List of word ids that appear in the address but should be ignored.
40     private $aAddressNonSearch = array();
41     /// Kind of search for special searches, see Nominatim::Operator.
42     private $iOperator = Operator::NONE;
43     /// Class of special feature to search for.
44     private $sClass = '';
45     /// Type of special feature to search for.
46     private $sType = '';
47     /// Housenumber of the object.
48     private $sHouseNumber = '';
49     /// Postcode for the object.
50     private $sPostcode = '';
51     /// Geographic search area.
52     private $oNearPoint = false;
53
54     // Temporary values used while creating the search description.
55
56     /// Index of phrase currently processed
57     private $iNamePhrase = -1;
58 };