pedrocorse Posted May 23, 2020 Report Share Posted May 23, 2020 Good morning all, I would like to do a direct search on a town without going through the multiple links of the places-oneletter.php page. I know that places-oneletter.php first searches the Town, then the Area code, County, Region, Country. So I modified in the placesearch.php page, the following code AND $ place = '$ psearch' by AND trim (substring_index ($ place, ',', 1)) = '$ psearch' to search directly the town. The search works by going to this link "www.mywebsite.com/placesearch.php?&psearch=town" but the search takes more than 2 minutes. How to search for a town directly ? or how to speed up my search ? Thank you for your help Quote Link to comment Share on other sites More sharing options...
theKiwi Posted May 24, 2020 Report Share Posted May 24, 2020 Why not use the place search box that is on places.php as well as on places-all.php and places-oneletter.php Roger Quote Link to comment Share on other sites More sharing options...
pedrocorse Posted May 24, 2020 Author Report Share Posted May 24, 2020 Hello, thank you for your answer. I already use places.php which I modified to have the town (and not countries) but when I click on a town to have all the information (birth, marriage, death, etc.) concerning this city, the link sends me back to place-oneletter.php. What I'm trying to do is get all informations about a city without having a different city by subdivision. Cordialy Quote Link to comment Share on other sites More sharing options...
bhemph Posted May 24, 2020 Report Share Posted May 24, 2020 Changing from a full place name match comparison to a trim match is going to slow your search down. You could try AND $place LIKE '$psearch,%' to see if that is any faster since that is saying the same thing as your trim matching. But if you are searching for some of the town/city names that may be common, you are ending up with people from lots of different places (ie London, Ontario, Canada; London, Burgundy, France; London, England; London, Arkansas, USA; London, Kentucky, USA; & London, Ohio, USA all would be in your list for London). A lot of places have another place somewhere else in the world that were named for them, while others had people in another place like and use the same name. So there are quite a few places that will show up which are different place in your search. That is why the search currently returns results to places-oneletter where you can select which one in particular you want and then the full place name is used by placesearch. Maybe you are needing to modify your places links to be to placesearch and send the full place name, then you don't need the TRIM or LIKE comparison query change? Quote Link to comment Share on other sites More sharing options...
Michel KIRSCH Posted May 24, 2020 Report Share Posted May 24, 2020 PedroCorse, (j'y vais en français, hein. Je pense que tu comprends...) Dans le fichier places.php, change la ligne 46 $offset = $offset ? $offset + 1 : 1; en $offset = $offset ? $offset + 1 : 3; 3 étant le n°d'ordre du village dans une séquence Village, Province, Pays. Si tu travailles en 5 niveaux (idem + subdivision et code) ton village est en position offset 5 ==> $offset = $offset ? $offset + 1 : 5; Donc la liste affichée sera directement celle des 30 villages les plus cités. Pour accéder aux événements liés à ce village, clique sur la petite loupe à droite du nom, pas sur le nom du village. Sinon, tu auras accès à une subdivision de ce village s'il en existe. Michel Quote Link to comment Share on other sites More sharing options...
pedrocorse Posted May 25, 2020 Author Report Share Posted May 25, 2020 Il y a 22 heures , bhemph said: Changing from a full place name match comparison to a trim match is going to slow your search down. You could try AND $place LIKE '$psearch,%' to see if that is any faster since that is saying the same thing as your trim matching. But if you are searching for some of the town/city names that may be common, you are ending up with people from lots of different places (ie London, Ontario, Canada; London, Burgundy, France; London, England; London, Arkansas, USA; London, Kentucky, USA; & London, Ohio, USA all would be in your list for London). A lot of places have another place somewhere else in the world that were named for them, while others had people in another place like and use the same name. So there are quite a few places that will show up which are different place in your search. That is why the search currently returns results to places-oneletter where you can select which one in particular you want and then the full place name is used by placesearch. Maybe you are needing to modify your places links to be to placesearch and send the full place name, then you don't need the TRIM or LIKE comparison query change? Hello, I already use AND LIKE "$ psearch%" this way, it's barely faster. My association gathers all the information concerning Corsica and only Corsica therefore there will not be two same village name. I try to display all the elements concerning a village whatever the subdivision, I sometimes have a vilage with 1300 different subdivision. I try to display on the same page everything about this village (with the 1300 subdivision included). Cordialy Il y a 18 heures , Michel KIRSCH said: PedroCorse, (j'y vais en français, hein. Je pense que tu comprends...) Dans le fichier places.php, change la ligne 46 $offset = $offset ? $offset + 1 : 1; en $offset = $offset ? $offset + 1 : 3; 3 étant le n°d'ordre du village dans une séquence Village, Province, Pays. Si tu travailles en 5 niveaux (idem + subdivision et code) ton village est en position offset 5 ==> $offset = $offset ? $offset + 1 : 5; Donc la liste affichée sera directement celle des 30 villages les plus cités. Pour accéder aux événements liés à ce village, clique sur la petite loupe à droite du nom, pas sur le nom du village. Sinon, tu auras accès à une subdivision de ce village s'il en existe. Michel Bonjour Michel, merci pour l'astuce mais ça ne fonctionne pas, j'explique pourquoi. Tout d'abord mon association regroupe toutes les données de tous les villages de Corse et uniquement ceux de Corse. Ensuite pour chaque village, chaque dépouilleur a inscrit des informations dans les subdivision ce qui m'amène parfois à avoir plus de 1300 subdivisions différente pour un même village. je ne peux donc pas avoir la loupe sur la page places.php puisqu'il y a autant de réponse que de subdivision. je cherche à afficher sur une seule page toutes les données d'un village (avec les 1300 subdivisions) et non une page par subdivision.. Merci de votre aide Quote Link to comment Share on other sites More sharing options...
Michel KIRSCH Posted May 25, 2020 Report Share Posted May 25, 2020 Alors mieux vaut peut-être développer un outil de maintenance secondaire après importation qui "range" les villages dans une autre table... Quote Link to comment Share on other sites More sharing options...
pedrocorse Posted May 25, 2020 Author Report Share Posted May 25, 2020 Trop compliqué pour moi. Ma solution fonctionne mais prend plus de 2 minutes pour afficher la réponse, une idée pour accélérer ça ? Quote Link to comment Share on other sites More sharing options...
Michel KIRSCH Posted May 25, 2020 Report Share Posted May 25, 2020 Difficile, sans voir ou un code ou un résultat... Un lien vers le site ou fichier code....? Michel Quote Link to comment Share on other sites More sharing options...
pedrocorse Posted May 25, 2020 Author Report Share Posted May 25, 2020 (edited) J'ai remplacé ligne 137 de la page placesearch.php $allwhere2 .= " AND $place = '$psearch'" par $allwhere2 .= " AND $place LIKE '$psearch%'"; la réponse, comme c'est un like, met 2 minutes à s'affiché. De plus je n'ai pas autant de réponse qu'en local, j'ai seulement naissance, baptême, décès et sepulture et pas le reste J'ai vu que vous vous êtes connecté du coup j'ai supprimé les identifiants. la page que j'ai créé est placesearch1.php Edited May 25, 2020 by pedrocorse Quote Link to comment Share on other sites More sharing options...
Michel KIRSCH Posted May 25, 2020 Report Share Posted May 25, 2020 Pedro, suivez l'évolution de votre offset en plaçant la souris sur le lien "Bastia". En cliquant sur le lien vous remontez d'un niveau... Essayez de jouer sur l'offset dans le code, comme indiqué plus haut... En commenc-çant à 5 et non à 1 et en décrémentant. L'idéal serait que vous travailliez non pas avec Bastia,2b033,Haute-Corse,Corse,France,Giulietta mais avec une structure (plus logique) comme Giulietta,Bastia,2b033,Haute-Corse,Corse,France Cette structure est plus logique, un simple outil de maintenance pourrait faire les modifications après import et TNG travaillerait à votre guise. (J'en avais déjà parlé avec André il y a quelques jours sur le forum TNG Fr) Désolé, je ne peux pas faire mieux d'ici... Michel Quote Link to comment Share on other sites More sharing options...
pedrocorse Posted May 25, 2020 Author Report Share Posted May 25, 2020 Merci pour votre réponse, j'ai suivi la conversation sur TNG fr. Le problème est que heredis export le gedcom de cette façon : Town, Area code, County, Region, Country, Subdivision Je suis assez calé pour faire quelques modifs et créé des mods mais pas assez pour faire cet outil de maintenance. En gros que dirait cet outil ? on déplacerait dans la base de donnée tous les derniers éléments avant la dernière virgule et on les mettrait en premier, c'est ça ? Merci encore de votre aide Quote Link to comment Share on other sites More sharing options...
Michel KIRSCH Posted May 25, 2020 Report Share Posted May 25, 2020 Ben oui. Mais il faut le faire dans plusieurs tables... Je vais étudier cela. Rendez-vous sur le forum Fr dans quelques jours... Quote Link to comment Share on other sites More sharing options...
Michel KIRSCH Posted May 25, 2020 Report Share Posted May 25, 2020 Déjà, en gros, un enregistrement "lieu" peut être mis en array, avec un explode sur la virgule et on reconstruit le lieu avec array[4] . ",". array[0] . "," . ......1 . 2 . 3 Quote Link to comment Share on other sites More sharing options...
pedrocorse Posted May 26, 2020 Author Report Share Posted May 26, 2020 Merci michel, on se retrouve sur le forum français, bonne journée. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.