Browse Source

fix 664: exclude warnings from api.

eugene 7 years ago
parent
commit
82e9f16ba8

+ 2 - 2
api/java/SphinxClient.java

@@ -509,7 +509,7 @@ public class SphinxClient
 	/** Set matching mode. DEPRECATED */
 	public void SetMatchMode(int mode) throws SphinxException
 	{
-		System.out.println ( "DEPRECATED: Do not call this method or, even better, use SphinxQL instead of an API\n" );
+		//System.out.println ( "DEPRECATED: Do not call this method or, even better, use SphinxQL instead of an API\n" );
 		myAssert (
 			mode==SPH_MATCH_ALL ||
 			mode==SPH_MATCH_ANY ||
@@ -746,7 +746,7 @@ public class SphinxClient
 	 */
 	public void SetOverride ( String attrname, int attrtype, Map values ) throws SphinxException
 	{
-		System.out.println ( "DEPRECATED: Do not call this method. Use SphinxQL REMAP() function instead.\n" );
+		//System.out.println ( "DEPRECATED: Do not call this method. Use SphinxQL REMAP() function instead.\n" );
 		myAssert ( attrname!=null && attrname.length()>0, "attrname must not be empty" );
 		myAssert ( attrtype==SPH_ATTR_INTEGER || attrtype==SPH_ATTR_TIMESTAMP || attrtype==SPH_ATTR_BOOL || attrtype==SPH_ATTR_FLOAT || attrtype==SPH_ATTR_BIGINT,
 			"unsupported attrtype (must be one of INTEGER, TIMESTAMP, BOOL, FLOAT, or BIGINT)" );

+ 2 - 2
api/libsphinxclient/sphinxclient.c

@@ -529,7 +529,7 @@ sphinx_bool sphinx_set_max_query_time ( sphinx_client * client, int max_query_ti
 // DEPRECATED
 sphinx_bool sphinx_set_match_mode ( sphinx_client * client, int mode )
 {
-	fprintf ( stderr, "DEPRECATED: Do not call this method or, even better, use SphinxQL instead of an API\n" );
+	//fprintf ( stderr, "DEPRECATED: Do not call this method or, even better, use SphinxQL instead of an API\n" );
 
 	if ( !client || mode<SPH_MATCH_ALL || mode>SPH_MATCH_EXTENDED2 ) // FIXME?
 	{
@@ -866,7 +866,7 @@ sphinx_bool sphinx_add_override ( sphinx_client * client, const char * attr, con
 {
 	struct st_override * p;
 
-	fprintf ( stderr, "DEPRECATED: Do not call this method. Use SphinxQL REMAP() function instead.\n" );
+	//fprintf ( stderr, "DEPRECATED: Do not call this method. Use SphinxQL REMAP() function instead.\n" );
 
 	if ( !client )
 		return SPH_FALSE;

+ 2 - 2
api/ruby/lib/sphinx/client.rb

@@ -264,7 +264,7 @@ module Sphinx
     
     # Set matching mode. DEPRECATED
     def SetMatchMode(mode)
-      $stderr.puts "DEPRECATED: Do not call this method or, even better, use SphinxQL instead of an API\n"
+      # $stderr.puts "DEPRECATED: Do not call this method or, even better, use SphinxQL instead of an API\n"
       assert { mode == SPH_MATCH_ALL \
             || mode == SPH_MATCH_ANY \
             || mode == SPH_MATCH_PHRASE \
@@ -492,7 +492,7 @@ module Sphinx
 	  # There can be only one override per attribute.
 	  # +values+ must be a hash that maps document IDs to attribute values.
 	  def SetOverride(attrname, attrtype, values)
-      $stderr.puts "DEPRECATED: Do not call this method. Use SphinxQL REMAP() function instead.\n"
+      # $stderr.puts "DEPRECATED: Do not call this method. Use SphinxQL REMAP() function instead.\n"
       assert { attrname.instance_of? String }
       assert { [SPH_ATTR_INTEGER, SPH_ATTR_TIMESTAMP, SPH_ATTR_BOOL, SPH_ATTR_FLOAT, SPH_ATTR_BIGINT].include?(attrtype) }
       assert { values.instance_of? Hash }

+ 2 - 2
api/sphinxapi.php

@@ -775,7 +775,7 @@ class SphinxClient
 	/// set matching mode
 	function SetMatchMode ( $mode )
 	{
-		trigger_error ( 'DEPRECATED: Do not call this method or, even better, use SphinxQL instead of an API', E_USER_DEPRECATED );
+		// trigger_error ( 'DEPRECATED: Do not call this method or, even better, use SphinxQL instead of an API', E_USER_DEPRECATED );
 		assert ( $mode==SPH_MATCH_ALL
 			|| $mode==SPH_MATCH_ANY
 			|| $mode==SPH_MATCH_PHRASE
@@ -975,7 +975,7 @@ class SphinxClient
 	/// $values must be a hash that maps document IDs to attribute values
 	function SetOverride ( $attrname, $attrtype, $values )
 	{
-		trigger_error('DEPRECATED: Do not call this method. Use SphinxQL REMAP() function instead.', E_USER_DEPRECATED);
+		// trigger_error('DEPRECATED: Do not call this method. Use SphinxQL REMAP() function instead.', E_USER_DEPRECATED);
 		assert ( is_string ( $attrname ) );
 		assert ( in_array ( $attrtype, array ( SPH_ATTR_INTEGER, SPH_ATTR_TIMESTAMP, SPH_ATTR_BOOL, SPH_ATTR_FLOAT, SPH_ATTR_BIGINT ) ) );
 		assert ( is_array ( $values ) );

+ 3 - 1
api/sphinxapi.py

@@ -365,8 +365,8 @@ class SphinxClient:
 	def SetMatchMode (self, mode):
 		"""
 		Set matching mode.
-		"""
 		print('DEPRECATED: Do not call this method or, even better, use SphinxQL instead of an API', file=sys.stderr)
+		"""
 		assert(mode in [SPH_MATCH_ALL, SPH_MATCH_ANY, SPH_MATCH_PHRASE, SPH_MATCH_BOOLEAN, SPH_MATCH_EXTENDED, SPH_MATCH_FULLSCAN, SPH_MATCH_EXTENDED2])
 		self._mode = mode
 
@@ -521,7 +521,9 @@ class SphinxClient:
 
 
 	def SetOverride (self, name, type, values):
+		"""
 		print('DEPRECATED: Do not call this method. Use SphinxQL REMAP() function instead.', file=sys.stderr)
+		"""
 		assert(isinstance(name, str))
 		assert(type in SPH_ATTR_TYPES)
 		assert(isinstance(values, dict))