ordering by number

This topic contains 3 replies, has 2 voices, and was last updated by

 
Keymaster
2 years, 6 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #23634

    Participant

    Hello I have installed succefuly “the Ajax Search Pro for WordPress”.

    I have posts with this kind of title.
    “Articulo 1 del codigo civil”
    “Articulo 2 del codigo civil”
    “Articulo 3 del codigo civil”
    .
    .
    “Articulo 2300 del codigo civil”, and so.
    As you can see, the only diference is the NUMBER in the post title.

    When I want to find a post using just the number (it is the idea), the results are not ordered (from the lowest number) so I cannot reach the correct post at once.
    The attached image shows what happens when I insert just “3”, several having 3, but not just “3” as the first result.

    How can I get the results in the correct order?

    regards
    [email protected]

    Attachments:
    You must be logged in to view attached files.
    #23641

    Hi,

    I am not sure if this is possible to be honest. It is not the plugins fault, but the SQL server does the ordering alphabetically, since the titles are strings and not numbers alone.

    If you check the ordering:

    Artículo 1003..
    Artículo 1013..
    Artículo 1023.
    Artículo 103

    ..alphabetical ordering is correct. It would only work differently, if there was a leading-zero character before the strings:

    Artículo 00001..
    Artículo 00002..
    Artículo 00003..
    Artículo 00004…

    ..and so on.

    I could try to make a modification to cast the titles as numbers, but it may not work either as there are alphanumeric characters as well. If you want, you can add temporary FTP and back-end details, and I can try a modification, but I don’t know if this is possible to achieve.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #23675

    Participant

    Hello

    I think a leading-zero character before the strings, is not natural for the customers.

    Is there a way to put an special “string” or “number” (a key (additional search tag)) in each post in order to force to search for this key in the category I want to do the search. Once it’s found, to show the title and excerpt in the search results (key ordered).

    By the way, the insertion must be masive (there are several posts (in the category) no chance to do it manualy) (I iuse “WP Ultimate CSV Importer” (free version) to inset posts)

    Asking the same in other way.
    Can I do a search only for the tags (additional seach tag) for all the posts inside a particular category? How?
    Can I bulk insert this “tag” in current posts?

    #23687

    Hi,

    There is an option on the plugin back-end to sort by numeric custom field, that should be the key solution to it. So you could basically create a custom field, add the number there, and then set the ordering by it on the General Options -> Ordering panel.

    The additional search tags are stored in a custom field: _asp_additional_tags
    But, you can also import the keywords to another custom field as well, and then choose only to search that on the General Options -> Sources panel.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.