These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

Search with swagger and space in search string

Author
Vex Munda
Anti Enslavement Movement
#1 - 2017-03-23 10:17:08 UTC
Hey,

I am trying to search people names with Swagger: https://esi.tech.ccp.is/dev/#!/Search/get_search.

It works as expected except for one thing; If I request a search query with a space, it returns the names that have both parts of the search query in it. I ll clarify with an example:

Search term: "Vex M". This will return Vex Munda, but also others like "Vexus Malius" and "Vexing Mordina". So it treats the search text before and after the space seperately.

What I want is that searching "Vex M" would result in names like Vex Munda, Vex Mayaki, etc.

So I want it to search for "Vex M" and not or "Vex" and "M".

Anyone know how to do this?

thx for your replies.

PS: Using strict=true also won't work, because I don't want to search the entire name.


Blacksmoke16
Resilience.
#2 - 2017-03-23 14:06:01 UTC
Use a combination of strict and wildcards to do the search.

https://esi.tech.ccp.is/v2/search/?categories=character&search=Vex M*&strict=true




Example output (after running results to /names/ endpoint):

[
  {
    "id": 1826077955,
    "name": "Vex Mortes",
    "category": "character"
  },
  {
    "id": 663090826,
    "name": "Vex Morga",
    "category": "character"
  },
  {
    "id": 94401565,
    "name": "Vex MacDuff",
    "category": "character"
  },
  {
    "id": 94083854,
    "name": "Vex Maulerant",
    "category": "character"
  },
  {
    "id": 94612499,
    "name": "Vex Malden",
    "category": "character"
  },
  {
    "id": 179950620,
    "name": "Vex Malec",
    "category": "character"
  },
  {
    "id": 93920413,
    "name": "Vex Munda",
    "category": "character"
  },
  {
    "id": 94891425,
    "name": "Vex Moragh",
    "category": "character"
  },
  {
    "id": 2112501033,
    "name": "Vex Matorium",
    "category": "character"
  },
  {
    "id": 93174954,
    "name": "Vex Muldune",
    "category": "character"
  },
  {
    "id": 95924909,
    "name": "Vex Malleus",
    "category": "character"
  },
  {
    "id": 91743663,
    "name": "Vex Malefactor",
    "category": "character"
  },
  {
    "id": 94861360,
    "name": "Vex Mental",
    "category": "character"
  },
  {
    "id": 1040941066,
    "name": "Vex Mercher",
    "category": "character"
  },
  {
    "id": 91507443,
    "name": "Vex Muvila",
    "category": "character"
  },
  {
    "id": 95368970,
    "name": "Vex Mahyisti",
    "category": "character"
  },
  {
    "id": 96863024,
    "name": "Vex Mhythoclast",
    "category": "character"
  },
  {
    "id": 92860228,
    "name": "Vex Mohindar",
    "category": "character"
  },
  {
    "id": 91062738,
    "name": "Vex Mayaki",
    "category": "character"
  },
  {
    "id": 91873363,
    "name": "Vex Medicci",
    "category": "character"
  },
  {
    "id": 92339040,
    "name": "Vex Mars",
    "category": "character"
  },
  {
    "id": 91371619,
    "name": "Vex Motsu",
    "category": "character"
  },
  {
    "id": 95729508,
    "name": "Vex Mishi",
    "category": "character"
  },
  {
    "id": 93354601,
    "name": "Vex Masten",
    "category": "character"
  },
  {
    "id": 95632624,
    "name": "Vex Miles",
    "category": "character"
  },
  {
    "id": 2112269299,
    "name": "Vex Mortem",
    "category": "character"
  },
  {
    "id": 95157365,
    "name": "Vex Miromme",
    "category": "character"
  },
  {
    "id": 867381494,
    "name": "Vex McDugal",
    "category": "character"
  },
  {
    "id": 96485695,
    "name": "Vex Mythoclast",
    "category": "character"
  },
  {
    "id": 92644605,
    "name": "Vex McGruber",
    "category": "character"
  },
  {
    "id": 97134590,
    "name": "Vex Mernher",
    "category": "character"
  }
]
Vex Munda
Anti Enslavement Movement
#3 - 2017-03-23 14:42:22 UTC
Thanks Blacksmoke16, that is definitely the smart solution i was looking for.
Blacksmoke16
Resilience.
#4 - 2017-03-23 15:18:28 UTC
np :)